create-order.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <template>
  2. <view class="container order clearfix" :style="{ paddingBottom: isIphoneX ? '190rpx' : '134rpx' }">
  3. <!-- 地址选择 -->
  4. <cm-address-temp ref="choiceAddress" v-if="isRequest" :addressData="addressData" />
  5. <!-- 商品 -->
  6. <cm-goods-temp
  7. ref="goods"
  8. v-if="isRequest"
  9. :secondflag="secondflag"
  10. :goodsData.sync="goodsData"
  11. @handleGoodList="handChangeInputGoodsList"
  12. @changeChina="handleChangeChina"
  13. @changePostage="handleChangePostage"
  14. />
  15. <!-- 返佣订单 -->
  16. <!-- <view class="order-return" v-if="goodsData.length == 1 && secondflag">
  17. <view class="order-return-main" @click="handleRebateFlag">
  18. <view class="label">是否返佣</view>
  19. <view class="label-right">
  20. <text class="text-l">{{ rebateFeeText }}</text> <text class="iconfont icon-xiayibu"></text>
  21. </view>
  22. </view>
  23. <view class="order-return-input" v-if="confirmParam.payInfo.rebateFlag === 2">
  24. <input class="input" v-model="rebateFee" type="number" placeholder="请输入返佣服务费" maxlength="20" />
  25. </view>
  26. </view> -->
  27. <!-- 返佣订单 -->
  28. <!-- <view class="Rebate" @click="handleSecondFlag" v-if="!secondflag">
  29. <text class="rebate-title">二手返佣订单</text>
  30. <text class="iconfont" :class="rebatecheck ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
  31. </view> -->
  32. <!-- 发票信息 -->
  33. <cm-invice-popup
  34. ref="invoice"
  35. v-if="isRequest"
  36. :invoiceDatas="invoiceData"
  37. @handleChoiceaInvoice="handleChoiceaInvoiceData"
  38. />
  39. <!-- 优惠券选择弹窗 -->
  40. <cm-coupon-popup
  41. ref="coupon"
  42. v-if="isCouponShow"
  43. :couponList="couponList"
  44. @handleChoiceaCoupon="handleChoiceaCouponData"
  45. />
  46. <!-- 兑换优惠券弹窗 -->
  47. <cm-coupon-chang v-if="isExchangePopup" @changeCoupon="handleChangeCoupon"/>
  48. <!-- 优惠券 -->
  49. <cm-coupon-tips ref="coupon-tips" :coupon="ExchangeCouponData" @cancel="handleClickCancel" v-if="isCouponModel" />
  50. <!-- 余额抵扣 -->
  51. <view class="invoice-balance" v-if="isRequest && !rechargeGoods">
  52. <view class="balabce-t">
  53. <view class="balabce-t-le">余额抵扣:</view>
  54. <view class="balabce-t-ri">
  55. <view class="money">
  56. <text>可用余额:</text> <text>¥{{ userMoney | NumFormat }}</text>
  57. </view>
  58. <view class="checkbox-box">
  59. <button
  60. class="checkbox iconfont"
  61. hover-class="btn-hover"
  62. v-if="userMoney != 0"
  63. @click.stop="checkedBalabce"
  64. :class="[ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  65. ></button>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="balabce-b" :class="{ 'balabce-b--hide': !ischecked }">
  70. <view
  71. class="balabce-b-text animation"
  72. :style="{
  73. transform: ischecked ? 'translateY(0)' : 'translateY(-50%)',
  74. '-webkit-transform': ischecked ? 'translateY(0)' : 'translateY(-50%)'
  75. }"
  76. >
  77. <text>当前使用:¥{{ deductMoney | NumFormat }},剩余:¥{{ surplusMoney | NumFormat }}</text>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 选择对机构是否可见 -->
  82. <cm-club-visible ref="clubVisible" v-if="isRequest" @handleClubVisible="handleClubVisibleData" />
  83. <!-- 售后条例 -->
  84. <cm-regula-popup
  85. ref="regulations"
  86. v-if="isRequest && seconDepositFlg"
  87. :regulaDatas="clauseList"
  88. @handleData="handleClauseData"
  89. />
  90. <!-- 底部 -->
  91. <view class="footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  92. <view class="footer-le">
  93. <view class="footer-count">
  94. <text>共{{ totalCount }}件商品</text>
  95. </view>
  96. <view class="footer-price">
  97. <view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
  98. 总价:<text class="price">¥{{ orderShouldPayFee | NumFormat }}</text>
  99. </view>
  100. <view class="sum-none" v-if="totalDiscountAmount > 0">
  101. <text class="money-reduced"
  102. >共减<text>¥{{ totalDiscountAmount | NumFormat }}</text></text
  103. >
  104. </view>
  105. </view>
  106. </view>
  107. <view class="footer-submit" @click.stop="orderSubmitMit">
  108. <view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
  109. </view>
  110. </view>
  111. <!-- 弹窗提示 -->
  112. <tui-modal
  113. :show="modal"
  114. @click="handleClick"
  115. @cancel="hideMobel"
  116. :content="contentModalText"
  117. :button="modalButton"
  118. color="#333"
  119. :size="32"
  120. shape="circle"
  121. :maskClosable="false"
  122. >
  123. </tui-modal>
  124. </view>
  125. </template>
  126. <script>
  127. import cmAddressTemp from './components/cm-address-temp'
  128. import cmGoodsTemp from './components/cm-goods-temp'
  129. import cmInvicePopup from './components/cm-invice-popup'
  130. import cmFreightPopup from './components/cm-freight-popup'
  131. import cmCouponPopup from './components/cm-coupon-popup'
  132. import cmCouponChang from './components/cm-coupon-chang'
  133. import cmCouponTips from './components/cm-coupon-tips'
  134. import cmClubVisible from './components/cm-club-visible'
  135. import cmRegulaPopup from './components/cm-regula-popup'
  136. import conMixins from './mixins/conMixins.js'
  137. export default {
  138. mixins: [conMixins],
  139. components: {
  140. cmAddressTemp,
  141. cmGoodsTemp,
  142. cmInvicePopup,
  143. cmFreightPopup,
  144. cmCouponPopup,
  145. cmCouponChang,
  146. cmCouponTips,
  147. cmClubVisible,
  148. cmRegulaPopup
  149. },
  150. data() {
  151. return {
  152. isSubLoading: false,
  153. modalButton: [
  154. {
  155. text: '再想一想',
  156. type: 'gray',
  157. plain: true //是否空心
  158. },
  159. {
  160. text: '继续提交',
  161. customStyle: {
  162. color: '#fff',
  163. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  164. },
  165. plain: false
  166. }
  167. ],
  168. contentModalText: '', //操作文字提示语句
  169. modal: false,
  170. showModalstauts: 1,
  171. isIphoneX: this.$store.state.isIphoneX,
  172. confirmParam: {
  173. cartType: 3, // 购买类型:(1自主下单, 3协销下单)
  174. orderMiniType: 0, // 订单提交状态 0初始提交 1 继续提交
  175. orderSource: 6, // 订单来源 1WWW 6小程序[采美,星范]
  176. addressId: 0, // 收货地址Id
  177. clubCouponId: 0, // 关联优惠券Id
  178. clubId: 0, // 机构Id
  179. orderInfo: [], // 订单商品数据
  180. orderInvoice: { type: 0 }, // 订单发票信息
  181. orderSeen: 1, // 订单对机构可见度 1可见 2不可见
  182. payInfo: {
  183. // 订单金额数据
  184. orderShouldPayFee: 0, // 订单最终支付金额
  185. balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
  186. clauseId: 0, // 条款Id
  187. postage: 0, // 运费金额
  188. postageFlag: 0, // 运费类型
  189. userBeans: 0, // 抵扣采美豆数量
  190. rebateFee: 0, // 返佣服务费
  191. rebateFlag: 0 // 是否返佣订单
  192. },
  193. unionId: uni.getStorageSync('unionId') // 用户unionId
  194. },
  195. rebateFee: '',
  196. rebateFeeText: '否',
  197. confirmType: 1,
  198. submitState: '', // 提交状态
  199. isRequest: false, // 是否加载完成渲染子组件
  200. isFreight: false, // 是否加载完成渲染子组件
  201. isExchangePopup: false, // 控制兑换优惠券弹窗
  202. isfreightTip: false, // 控制邮费弹窗
  203. ischecked: false, // 是否勾选余额
  204. addressData: {}, // 初始化地址信息
  205. goodsData: [], // 初始化商品信息
  206. couponList: [], // 初始化优惠券信息
  207. invoiceData: { type: 0 }, // 初始化发票信息
  208. orderInfo: [], // 提交的商品信息
  209. payInfo: {}, // 订单信息
  210. rechargeGoods: false,
  211. clauseList: [],
  212. seconDepositFlg: true,
  213. rebatecheck: false,
  214. isCouponShow: false, // 是否显示可选优惠券
  215. secondflag: true,
  216. isCouponModel: false, // 兑换优惠券成功提示
  217. ExchangeCouponData: {} // 兑换优惠券信息
  218. }
  219. },
  220. onLoad(option) {
  221. //商品数据
  222. this.initStorage(option)
  223. },
  224. filters: {
  225. NumFormat(value) {
  226. //处理金额
  227. return Number(value).toFixed(2)
  228. }
  229. },
  230. methods: {
  231. async initStorage(option) {
  232. const data = JSON.parse(option.data)
  233. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  234. const userInfo = await this.$api.getStorage()
  235. this.handleComType = option.type * 1
  236. this.productParam.clubId = this.cartParam.clubId = this.confirmParam.clubId = clubInfo.clubId
  237. this.productParam.serviceProviderId = userInfo.serviceProviderId
  238. this.cartParam.serviceProviderId = userInfo.serviceProviderId
  239. this.confirmParam.serviceProviderId = userInfo.serviceProviderId
  240. if (option.type == '1') {
  241. this.confirmType = 1
  242. this.productParam.productCount = data.data.productCount
  243. this.productParam.productId = data.data.productIds
  244. this.getAddressData(clubInfo.userId, 1)
  245. } else {
  246. this.confirmType = 2
  247. this.cartParam.skuIds = data.data.skuIds
  248. this.getAddressData(clubInfo.userId, 2)
  249. }
  250. },
  251. //协销购物车跳转确认订单初始化信息
  252. async getInitCrearOrder() {
  253. try {
  254. const res = await this.SellerService.SellerSettlement(this.cartParam)
  255. const data = res.data
  256. this.goodsData = data.list.map(el => {
  257. el.handlePostageFlag = el.postageFlag
  258. return el
  259. })
  260. this.userMoney = data.userMoney
  261. this.couponList = data.couponList
  262. this.reducedPrice = data.reducedPrice
  263. this.totalCount = data.totalCount
  264. this.allPrice = data.totalPrice
  265. this.rechargeGoods = data.includeRecharge
  266. this.clauseList = data.clauseList
  267. this.isCouponShow = true
  268. if (this.couponList.length > 0) {
  269. this.couponAmount = data.couponList[0].couponAmount
  270. this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
  271. }
  272. this.orderShouldPayFee = this.allPrice - this.couponAmount
  273. this.isRequest = true
  274. } catch (error) {
  275. console.log('获取订单信息异常')
  276. }
  277. },
  278. //二手下单初始化查询
  279. async getInitProdcutCrearOrder() {
  280. try {
  281. this.seconDepositFlg = false
  282. const res = await this.SellerService.GetSettlementBySencondProduct(this.productParam)
  283. const data = res.data
  284. this.goodsData = data.list.map(el => {
  285. el.handlePostageFlag = el.postageFlag
  286. return el
  287. })
  288. this.userMoney = data.userMoney
  289. this.totalCount = data.totalCount
  290. this.allPrice = data.totalPrice
  291. this.orderShouldPayFee = this.allPrice
  292. this.isCouponShow = false
  293. this.secondflag = false
  294. this.isRequest = true
  295. } catch (error) {
  296. console.log('获取订单信息异常')
  297. }
  298. },
  299. //获取地址信息
  300. async getAddressData(userId, type) {
  301. try {
  302. const params = { pageNum: 1, pageSize: 1, userId: userId }
  303. const res = await this.UserService.QueryAddressList(params)
  304. const data = res.data
  305. if (data.list && data.list.length > 0) {
  306. this.addressData = data.list[0]
  307. this.confirmParam.addressId = this.addressData.addressId
  308. this.cartParam.cityId = this.addressData.cityId
  309. this.productParam.cityId = this.addressData.cityId
  310. }
  311. if (type === 1) {
  312. //立即都买提交
  313. this.getInitProdcutCrearOrder()
  314. }
  315. if (type === 2) {
  316. //购物车提交
  317. this.getInitCrearOrder()
  318. }
  319. } catch (error) {
  320. console.log('获取订单地址异常')
  321. }
  322. },
  323. handChangeInputGoodsList(data) {
  324. //对应供应商的留言信息
  325. this.goodsData = data
  326. },
  327. handleChoiceaInvoiceData(data) {
  328. //获取发票信息
  329. this.confirmParam.orderInvoice = data
  330. },
  331. handleClauseData(clauseId) {
  332. // 条款Id
  333. this.confirmParam.payInfo.clauseId = parseInt(clauseId)
  334. },
  335. handleChoiceaCouponData(data) {
  336. // 勾选使用优惠券
  337. console.log('优惠券信息', data)
  338. this.couponAmount = data.couponAmount
  339. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  340. this.confirmParam.clubCouponId = data.clubCouponId
  341. this.attributePallPrice()
  342. },
  343. handleClubVisibleData(data) {
  344. // 订单对机构是否可见
  345. console.log('对机构是否可见', data)
  346. this.confirmParam.orderSeen = Number(data)
  347. },
  348. orderSubmitMit() {
  349. //提交订单
  350. if (this.confirmParam.addressId == '') {
  351. this.$util.msg('请先添加收货地址~', 2000)
  352. return
  353. }
  354. this.SellerCreateOrderSubmit()
  355. // if (this.confirmParam.payInfo.rebateFlag === 2) {
  356. // if (this.rebateFee == 0) {
  357. // this.$util.msg('请输入返佣服务费', 2000)
  358. // return
  359. // }
  360. // this.confirmParam.payInfo.rebateFee = Number(this.rebateFee).toFixed(2)
  361. // }
  362. // this.modal = true
  363. // this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
  364. },
  365. SellerCreateOrderSubmit() {
  366. //提交订单
  367. if (this.isSubLoading) {
  368. return
  369. }
  370. this.confirmParam.orderInfo = this.hanldeProcessing()
  371. this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
  372. this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
  373. this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
  374. this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
  375. this.isSubLoading = true
  376. this.hanldeOrderSubmit(this.confirmParam)
  377. },
  378. // 处理数据格式
  379. hanldeProcessing() {
  380. return this.goodsData.map(el => {
  381. let productInfo = []
  382. el.cartList.forEach(pros => {
  383. productInfo.push({
  384. skuId: pros.skuId,
  385. productNum: pros.number,
  386. presentNum: 0,
  387. productType: pros.giftType
  388. })
  389. })
  390. return {
  391. splitCode: el.splitCode,
  392. shopId: el.shopId,
  393. note: el.note ? el.note : '',
  394. postage: el.isColdChina
  395. ? parseInt(el.postage + el.coldChain).toFixed(2)
  396. : parseInt(el.postage).toFixed(2),
  397. postageFlag: parseInt(el.handlePostageFlag),
  398. isColdChina: el.isColdChina ? 1 : 0,
  399. productInfo: productInfo
  400. }
  401. })
  402. },
  403. // 提交订单
  404. async hanldeOrderSubmit(params) {
  405. try {
  406. const res = await this.SellerService.SellerCreateOrderSubmit(params)
  407. const data = res.data
  408. if (data.code === 1) {
  409. this.$util.msg('支付成功', 2000, true, 'success')
  410. setTimeout(() => {
  411. this.isSubLoading = false
  412. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  413. }, 2000)
  414. } else {
  415. this.$util.msg('订单提交成功', 2000, true, 'success')
  416. setTimeout(() => {
  417. this.isSubLoading = false
  418. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  419. }, 2000)
  420. }
  421. } catch (error) {
  422. this.isSubLoading = false
  423. this.handleError(error)
  424. }
  425. },
  426. handleError(data) {
  427. // 提交订单异常处理
  428. this.formatConfirmParam()
  429. const buttonMap = {
  430. 1: {
  431. contentModalText:
  432. '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。',
  433. modalButton: [
  434. { text: '取消', type: 'gray', plain: true },
  435. {
  436. text: '继续提交',
  437. customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)' },
  438. plain: false
  439. }
  440. ]
  441. }
  442. }
  443. if (data.code === -6) {
  444. // 非医美机构下三类商品订单
  445. this.modal = true
  446. this.showModalstauts = 2
  447. this.contentModalText = buttonMap[1].contentModalText
  448. this.modalButton = buttonMap[1].modalButton
  449. } else {
  450. this.$util.msg(data.msg, 3000)
  451. }
  452. },
  453. formatConfirmParam() {
  454. // 还原提交订单参数格式
  455. this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
  456. this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
  457. this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
  458. },
  459. handleRebateFlag() {
  460. // 普通订单返佣
  461. let self = this
  462. uni.showActionSheet({
  463. itemList: ['返佣订单', '普通订单,存在返佣服务费', '否'],
  464. success: e => {
  465. switch (e.tapIndex) {
  466. case 0:
  467. self.confirmParam.payInfo.rebateFlag = 1
  468. self.rebateFeeText = '返佣订单'
  469. break
  470. case 1:
  471. self.confirmParam.payInfo.rebateFlag = 2
  472. self.rebateFeeText = '普通订单,存在返佣服务费'
  473. break
  474. case 2:
  475. self.confirmParam.payInfo.rebateFlag = 0
  476. self.rebateFeeText = '否'
  477. break
  478. }
  479. }
  480. })
  481. if (this.confirmParam.payInfo.rebateFlag === 1) {
  482. this.confirmParam.payInfo.balancePayFlag = 0
  483. this.couponAmount = 0
  484. this.confirmParam.clubCouponId = 0
  485. this.confirmParam.orderSeen = 2
  486. this.$refs.clubVisible.orderVisibleText = '不可见'
  487. this.$refs.clubVisible.current = 1
  488. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  489. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  490. this.$refs.coupon.coupon.couponAmount = 0
  491. this.$refs.freight.infoData(this.freightData)
  492. this.$refs.freight.freightData = this.freightData
  493. this.handleFreightData = this.freightData
  494. } else {
  495. this.confirmParam.orderSeen = 1
  496. this.$refs.clubVisible.orderVisibleText = '可见'
  497. if (this.couponList.length > 0) {
  498. this.confirmParam.clubCouponId = this.couponList[0].clubCouponId
  499. this.$refs.coupon.coupon.couponAmount = this.couponAmount = this.couponList[0].couponAmount
  500. }
  501. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  502. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  503. }
  504. },
  505. handleClick(e) {
  506. //确认提交
  507. if (e.index == 1) {
  508. if (this.showModalstauts == 2) {
  509. this.confirmParam.orderMiniType = 2
  510. this.SellerCreateOrderSubmit()
  511. } else {
  512. this.SellerCreateOrderSubmit()
  513. }
  514. }
  515. this.confirmParam.orderMiniType = 0
  516. this.modal = false
  517. },
  518. handleSecondFlag() {
  519. // 二手订单勾选返佣
  520. this.rebatecheck = !this.rebatecheck
  521. if (this.rebatecheck) {
  522. this.ischecked = false
  523. this.confirmParam.payInfo.rebateFlag = 1
  524. this.confirmParam.payInfo.balancePayFlag = 0
  525. this.confirmParam.clubCouponId = 0
  526. this.confirmParam.orderSeen = 2
  527. this.$refs.clubVisible.orderVisibleText = '不可见'
  528. this.$refs.clubVisible.current = 1
  529. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  530. this.$refs.freight.infoData(this.freightData)
  531. this.$refs.freight.freightData = this.freightData
  532. this.handleFreightData = this.freightData
  533. } else {
  534. this.confirmParam.orderSeen = 1
  535. this.$refs.clubVisible.orderVisibleText = '可见'
  536. this.confirmParam.payInfo.rebateFlag = 0
  537. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  538. }
  539. },
  540. handFreightAlertShow() {
  541. //显示邮费弹窗
  542. this.isfreightTip = true
  543. },
  544. handleChangeCoupon(data){
  545. this.ExchangeCouponData = data
  546. this.isExchangePopup = false
  547. this.isCouponModel = true
  548. this.getInitCrearOrder()
  549. },
  550. handleClickCancel() {
  551. // 关闭优惠券弹窗
  552. this.isCouponModel = false
  553. this.getInitCrearOrder()
  554. },
  555. hideFreight() {
  556. //关闭邮费弹窗
  557. this.isfreightTip = false
  558. },
  559. hideMobel() {
  560. this.modal = false
  561. }
  562. },
  563. onShow() {
  564. let pages = getCurrentPages()
  565. let currPage = pages[pages.length - 1]
  566. if (currPage.data.select == 'select') {
  567. let address = uni.getStorageSync('selectAddress')
  568. this.confirmParam.addressId = address.addressId
  569. this.cartParam.cityId = address.cityId
  570. this.productParam.cityId = address.cityId
  571. this.addressData = address
  572. this.ischecked = false
  573. this.isRequest = false
  574. if (this.handleComType === 1) {
  575. //立即都买提交
  576. this.getInitProdcutCrearOrder()
  577. }
  578. if (this.handleComType === 2) {
  579. //购物车提交
  580. this.getInitCrearOrder()
  581. }
  582. }
  583. }
  584. }
  585. </script>
  586. <style lang="scss">
  587. page {
  588. height: auto;
  589. background: #f7f7f7;
  590. }
  591. .btn-hover {
  592. background: #ffffff;
  593. }
  594. .animation {
  595. /* transition: transform 0.3s ease;*/
  596. transition-property: transform;
  597. transition-duration: 0.3s;
  598. transition-timing-function: ease;
  599. }
  600. .invoice-freight {
  601. width: 702rpx;
  602. padding: 0 24rpx;
  603. height: 86rpx;
  604. line-height: 86rpx;
  605. font-size: $font-size-28;
  606. color: $text-color;
  607. background: #ffffff;
  608. float: left;
  609. font-weight: bold;
  610. .freight-left {
  611. float: left;
  612. .icon-yunfeishuoming {
  613. height: 100%;
  614. padding: 0 15rpx;
  615. color: $color-system;
  616. font-weight: normal;
  617. }
  618. }
  619. .freight-right {
  620. float: right;
  621. color: #2a81ff;
  622. }
  623. }
  624. .invoice-balance {
  625. width: 702rpx;
  626. height: auto;
  627. padding: 0 24rpx;
  628. background: #ffffff;
  629. float: left;
  630. margin-top: 24rpx;
  631. margin-bottom: 24rpx;
  632. .balabce-t {
  633. width: 100%;
  634. height: 86rpx;
  635. line-height: 86rpx;
  636. font-size: $font-size-28;
  637. color: $text-color;
  638. float: left;
  639. .balabce-t-le {
  640. float: left;
  641. font-weight: bold;
  642. }
  643. .balabce-t-ri {
  644. float: right;
  645. display: flex;
  646. align-items: center;
  647. .money {
  648. display: flex;
  649. float: left;
  650. }
  651. .checkbox-box {
  652. display: flex;
  653. width: 60rpx;
  654. float: left;
  655. height: 100%;
  656. font-size: $font-size-24;
  657. .checkbox {
  658. width: 40rpx;
  659. text-align: right;
  660. box-sizing: border-box;
  661. text-align: center;
  662. text-decoration: none;
  663. border-radius: 0;
  664. -webkit-tap-highlight-color: transparent;
  665. overflow: hidden;
  666. color: $color-system;
  667. padding: 5rpx;
  668. }
  669. }
  670. }
  671. }
  672. .balabce-b {
  673. width: 100%;
  674. float: left;
  675. overflow: hidden;
  676. .balabce-b-text {
  677. width: 100%;
  678. line-height: 58rpx;
  679. font-size: $font-size-24;
  680. color: #ff2a2a;
  681. text-align: right;
  682. float: right;
  683. }
  684. &.balabce-b--hide {
  685. padding: 0 0;
  686. height: 0px;
  687. line-height: 0px;
  688. }
  689. }
  690. }
  691. .footer {
  692. position: fixed;
  693. left: 0;
  694. bottom: 0;
  695. display: flex;
  696. align-items: center;
  697. width: 100%;
  698. height: 110rpx;
  699. line-height: 110rpx;
  700. justify-content: space-between;
  701. font-size: $font-size-28;
  702. background-color: #ffffff;
  703. z-index: 990;
  704. color: $text-color;
  705. .footer-le {
  706. width: 570rpx;
  707. height: 100%;
  708. float: left;
  709. }
  710. .footer-count {
  711. float: left;
  712. padding-left: 24rpx;
  713. width: 190rpx;
  714. box-sizing: border-box;
  715. font-size: $font-size-26;
  716. }
  717. .footer-price {
  718. width: 370rpx;
  719. float: right;
  720. text-align: right;
  721. color: $text-color;
  722. padding: 10rpx 20rpx 10rpx 0;
  723. box-sizing: border-box;
  724. .sum-none {
  725. width: 100%;
  726. height: 45rpx;
  727. line-height: 45rpx;
  728. color: $text-color;
  729. float: left;
  730. text-align: right;
  731. .money {
  732. font-size: $font-size-26;
  733. color: #999999;
  734. text-decoration: line-through;
  735. }
  736. .money-sign {
  737. font-size: $font-size-26;
  738. color: #999999;
  739. text-decoration: line-through;
  740. }
  741. .money-reduced {
  742. margin-left: 10rpx;
  743. font-size: $font-size-26;
  744. color: $color-system;
  745. }
  746. }
  747. .sum {
  748. width: 100%;
  749. height: 45rpx;
  750. line-height: 45rpx;
  751. float: left;
  752. &.none {
  753. height: 90rpx;
  754. line-height: 90rpx;
  755. }
  756. .price {
  757. font-size: $font-size-32;
  758. color: #ff2a2a;
  759. }
  760. }
  761. }
  762. .footer-submit {
  763. display: flex;
  764. align-items: center;
  765. justify-content: center;
  766. width: 180rpx;
  767. height: 100%;
  768. box-sizing: border-box;
  769. padding: 15rpx 5rpx;
  770. .btn {
  771. width: 100%;
  772. height: 100%;
  773. color: #ffffff;
  774. background: linear-gradient(90deg, #ff9300 0%, #ff5b00 100%);
  775. font-size: $font-size-26;
  776. text-align: center;
  777. line-height: 80rpx;
  778. border-radius: 40rpx;
  779. &.disabled {
  780. background: #e4e8eb;
  781. color: #999999;
  782. }
  783. }
  784. }
  785. }
  786. .order-return {
  787. width: 100%;
  788. height: auto;
  789. box-sizing: border-box;
  790. padding: 0 24rpx;
  791. background: #ffffff;
  792. float: left;
  793. margin: 24rpx 0;
  794. .order-return-main {
  795. width: 100%;
  796. height: 86rpx;
  797. line-height: 86rpx;
  798. .label {
  799. float: left;
  800. font-weight: bold;
  801. color: #333333;
  802. font-size: $font-size-28;
  803. }
  804. .label-right {
  805. float: right;
  806. color: #2a81ff;
  807. .text-l {
  808. font-size: 28rpx;
  809. font-weight: bold;
  810. margin-right: 20rpx;
  811. }
  812. .icon-xiayibu {
  813. line-height: 88rpx;
  814. color: #999999;
  815. font-weight: normal;
  816. }
  817. }
  818. }
  819. .order-return-input {
  820. width: 100%;
  821. height: 86rpx;
  822. padding-bottom: 20rpx;
  823. box-sizing: border-box;
  824. .input {
  825. width: 100%;
  826. height: 66rpx;
  827. font-size: $font-size-26;
  828. border: 1px solid #e1e1e1;
  829. line-height: 66rpx;
  830. color: #333333;
  831. border-radius: 4rpx;
  832. box-sizing: border-box;
  833. padding: 0 20rpx;
  834. }
  835. }
  836. }
  837. .Rebate {
  838. width: 702rpx;
  839. height: auto;
  840. padding: 0 24rpx;
  841. background: #ffffff;
  842. float: left;
  843. margin-bottom: 24rpx;
  844. margin-top: 24rpx;
  845. line-height: 86rpx;
  846. .rebate-title {
  847. float: left;
  848. font-weight: bold;
  849. color: #333333;
  850. font-size: $font-size-28;
  851. }
  852. .iconfont {
  853. float: right;
  854. color: #b2b2b2;
  855. font-size: 40rpx;
  856. &.icon-yixuanze {
  857. color: $color-system;
  858. }
  859. }
  860. }
  861. .coupon-content-model {
  862. width: 100%;
  863. height: 100%;
  864. background: rgba(0, 0, 0, 0.5);
  865. position: fixed;
  866. top: 0;
  867. left: 0;
  868. z-index: 8888;
  869. transition: all 0.4s;
  870. .coupon-alert-content {
  871. width: 600rpx;
  872. height: 612rpx;
  873. position: absolute;
  874. top: 0;
  875. left: 0;
  876. bottom: 0;
  877. right: 0;
  878. margin: auto;
  879. box-sizing: border-box;
  880. padding-top: 92rpx;
  881. .coupon {
  882. width: 600rpx;
  883. height: 522rpx;
  884. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  885. background-size: cover;
  886. box-sizing: border-box;
  887. padding: 230rpx 40rpx 0 40rpx;
  888. .coupon-list {
  889. width: 100%;
  890. height: 147rpx;
  891. margin-bottom: 32rpx;
  892. box-sizing: border-box;
  893. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  894. background-size: cover;
  895. position: relative;
  896. .list-cell-tags {
  897. display: inline-block;
  898. padding: 0 10rpx;
  899. height: 32rpx;
  900. line-height: 32rpx;
  901. background-color: #f94b4b;
  902. color: #ffffff;
  903. font-size: 18rpx;
  904. border-radius: 16rpx 0 16rpx 0;
  905. text-align: center;
  906. position: absolute;
  907. top: 0;
  908. left: 0;
  909. }
  910. .list-cell-le {
  911. width: 154rpx;
  912. height: 100%;
  913. box-sizing: border-box;
  914. padding: 30rpx 0;
  915. float: left;
  916. .coupon-maxMoney {
  917. width: 100%;
  918. height: 54rpx;
  919. line-height: 54rpx;
  920. font-size: 42rpx;
  921. color: #f94b4b;
  922. text-align: center;
  923. margin-top: 10rpx;
  924. .small {
  925. font-size: $font-size-20;
  926. }
  927. }
  928. .coupon-minMoney {
  929. width: 100%;
  930. height: 28rpx;
  931. float: left;
  932. box-sizing: border-box;
  933. padding-left: 24rpx;
  934. .txt {
  935. display: block;
  936. height: 28rpx;
  937. line-height: 28rpx;
  938. font-size: 16rpx;
  939. color: #f94b4b;
  940. text-align: center;
  941. padding: 0 5rpx;
  942. background-color: #fff1eb;
  943. border-radius: 4rpx;
  944. float: left;
  945. }
  946. }
  947. }
  948. .list-cell-ri {
  949. width: 366rpx;
  950. height: 100%;
  951. box-sizing: border-box;
  952. padding: 30rpx 20rpx;
  953. float: left;
  954. .list-cell-top {
  955. width: 100%;
  956. height: 64rpx;
  957. line-height: 64rpx;
  958. font-size: $font-size-26;
  959. color: #333333;
  960. float: left;
  961. text-overflow: ellipsis;
  962. display: -webkit-box;
  963. word-break: break-all;
  964. -webkit-box-orient: vertical;
  965. -webkit-line-clamp: 1;
  966. overflow: hidden;
  967. }
  968. .list-cell-time {
  969. width: 100%;
  970. height: 28rpx;
  971. line-height: 28rpx;
  972. text-align: left;
  973. font-size: $font-size-20;
  974. color: #999999;
  975. }
  976. }
  977. }
  978. .coupon-btn {
  979. width: 100%;
  980. height: 78rpx;
  981. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  982. background-size: cover;
  983. line-height: 78rpx;
  984. text-align: center;
  985. color: #ffffff;
  986. font-size: $font-size-36;
  987. }
  988. }
  989. }
  990. }
  991. </style>