create-order.vue 26 KB

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