create-order.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. <template>
  2. <view class="container order clearfix" :style="{paddingBottom :isIphoneX ? '170rpx' : '134rpx'}">
  3. <!-- 地址选择 -->
  4. <choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
  5. <!-- 商品 -->
  6. <goods-list ref='goods' v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList"></goods-list>
  7. <!-- 发票信息 -->
  8. <invoice-tent ref="invoice"
  9. v-if="isRequest"
  10. :invoiceDatas="invoiceData"
  11. @handleChoiceaInvoice="handleChoiceaInvoiceData">
  12. </invoice-tent>
  13. <!-- 优惠券选择弹窗 -->
  14. <coupon ref="coupon"
  15. v-if="isCouponShow"
  16. :couponList="couponList"
  17. @handleChoiceaCoupon="handleChoiceaCouponData">
  18. </coupon>
  19. <!-- 兑换优惠券弹窗 -->
  20. <exchangeCoupon v-if="isExchangePopup"></exchangeCoupon>
  21. <!-- 运费 -->
  22. <freight ref="freight"
  23. v-if="isFreight"
  24. :freightData="freightData"
  25. @confirmFreight="hanldFreightFn"
  26. @confirmFreightBeans = "hanldFreightBeans"
  27. >
  28. </freight>
  29. <freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
  30. <!-- 余额抵扣 -->
  31. <view class="invoice-balance" v-show="!rechargeGoods">
  32. <view class="balabce-t">
  33. <view class="balabce-t-le">余额抵扣</view>
  34. <view class="balabce-t-ri">
  35. <view class="money">
  36. <text>可用余额:</text>
  37. <text>¥{{userMoney | NumFormat}}</text>
  38. </view>
  39. <view class="checkbox-box">
  40. <button class="checkbox iconfont"
  41. hover-class="btn-hover"
  42. v-if="userMoney!=0"
  43. @click.stop="checkedBalabce"
  44. :class="[ischecked ?'icon-yixuanze':'icon-weixuanze']"
  45. >
  46. </button>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="balabce-b" :class="{'balabce-b--hide':!ischecked}">
  51. <view class="balabce-b-text animation" :style="{'transform':ischecked?'translateY(0)':'translateY(-50%)','-webkit-transform':ischecked?'translateY(0)':'translateY(-50%)'}">
  52. <text>当前使用:¥{{deductMoney | NumFormat}},剩余:¥{{surplusMoney | NumFormat}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 底部 -->
  57. <view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
  58. <view class="footer-le">
  59. <view class="footer-count">
  60. <text>共{{allCount}}件商品</text>
  61. </view>
  62. <view class="footer-price">
  63. <view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
  64. 总价:<text class="price">¥{{payAllPrice | NumFormat}}</text>
  65. </view>
  66. <view class="sum-none" v-if="totalDiscountAmount > 0">
  67. <text class="money-reduced">共减<text>¥{{ totalDiscountAmount | NumFormat}}</text></text>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="footer-submit" @click.stop="orderSubmitMit">
  72. <view class="btn" :class="isSubLoading ? 'disabled' : ''" >提交订单</view>
  73. </view>
  74. </view>
  75. <!-- 优惠券 -->
  76. <view class="coupon-content-model" v-if="isCouponModel">
  77. <view class="coupon-alert-content">
  78. <view class="coupon">
  79. <view class="coupon-list">
  80. <view class="list-cell-tags">{{ ExchangeCouponData.couponType | TypeFormat }}</text></view>
  81. <view class="list-cell-le">
  82. <view class="coupon-maxMoney">
  83. <text class="small">¥</text>
  84. {{ ExchangeCouponData.couponAmount }}
  85. </view>
  86. <view class="coupon-minMoney">
  87. <text class="txt">满{{ ExchangeCouponData.touchPrice }}可用</text>
  88. </view>
  89. </view>
  90. <view class="list-cell-ri">
  91. <view class="list-cell-top">
  92. <text v-if="ExchangeCouponData.couponType == 0">
  93. {{ ExchangeCouponData.productType && ExchangeCouponData.productType == 1 ? '全商城商品通用' : '仅可购买指定商品' }}
  94. </text>
  95. <text v-if="ExchangeCouponData.couponType == 1">
  96. {{ ExchangeCouponData.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
  97. </text>
  98. <text v-if="ExchangeCouponData.couponType == 3">仅限购买店铺【{{ ExchangeCouponData.shopName }}】的商品</text>
  99. <text v-if="ExchangeCouponData.couponType == 4 || ExchangeCouponData.couponType == 2">全商城商品通用</text>
  100. </view>
  101. <view class="list-cell-time">有效期:{{ ExchangeCouponData.endDate }}</view>
  102. </view>
  103. </view>
  104. <view class="coupon-btn" @click.stop="handleClickCancel">立即收下</view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import choiceAddress from '@/components/cm-module/creatOrder/choiceAddress'
  112. import goodsList from '@/components/cm-module/creatOrder/goodsList'
  113. import invoiceTent from '@/components/cm-module/creatOrder/invoiceTent'
  114. import coupon from '@/components/cm-module/creatOrder/coupon'
  115. import exchangeCoupon from '@/components/cm-module/creatOrder/exchangeCoupon'
  116. import freight from '@/components/cm-module/creatOrder/freight'
  117. import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
  118. export default {
  119. components:{
  120. choiceAddress,
  121. goodsList,
  122. invoiceTent,
  123. coupon,
  124. exchangeCoupon,
  125. freight,
  126. freightAlert
  127. },
  128. data() {
  129. return {
  130. isIphoneX:this.$store.state.isIphoneX,
  131. isSubLoading:false,
  132. orderID:0,
  133. productIds:'', // 获取上一级页面商品信息
  134. productCount:'', // 获取上一级页面商品数量
  135. classifyIDS:'', // 获取上一级页面商品分类
  136. userID:'', // 用户ID
  137. cartType:'', // 购买类型(1购物车提交,2直接购买提交)
  138. submitState:'', // 提交状态
  139. balanceDeductionFlag:2, // 勾选余额的状态(1使用,2不使用)
  140. allCount:1, // 订单提交总数量
  141. totalOriginalPrice:0, // 订单总原价(划线部分)
  142. reducedPrice:0, // 满减金额
  143. couponAmount:0, // 优惠券金额
  144. totalDiscountAmount:0, // 共减金额
  145. payAllPrice:0.00, // 订单提交总金额
  146. allPrice:0.00, // 订单总金额
  147. surplusMoney:0.00, // 显示勾选后的剩余抵扣
  148. userMoney:0.00, // 显示可使用余额
  149. deductMoney:0.00, // 显示已使用的余额
  150. addressID:'', // 地址ID
  151. townID:'', // 区ID
  152. isRequest:false, // 是否加载完成渲染子组件
  153. isFreight:false, // 是否加载完成渲染子组件
  154. isAddress:false, // 是否加载完成地址
  155. isExchangePopup:false, // 控制兑换优惠券弹窗
  156. isfreightTip:false, // 控制邮费弹窗
  157. ischecked:false, // 是否勾选余额
  158. hanldFreePostFlag:'', // 邮费状态
  159. hanldFreight:'', // 邮费
  160. addressData:{}, // 初始化地址信息
  161. goodsData:[], // 初始化商品信息
  162. couponList:[], // 初始化优惠券信息
  163. invoiceData:{type:0}, // 初始化发票信息
  164. freightData:{}, // 邮费数据
  165. orderInfo:[], // 提交的商品信息
  166. payInfo:{}, // 订单信息
  167. clubCouponId:0, // 用户关联优惠Id
  168. rechargeGoods:null, // 判断订单里有定金商品或者充值商品时,余额抵扣部分不显示
  169. freightBeansMoney:0, // 存储采美豆抵扣金额
  170. hanldUserBeans:0, // 抵扣的采美豆数
  171. isCouponShow:false, // 是否显示可选优惠券
  172. isCheckedBeans:false, // 是否抵扣采美豆
  173. isCouponModel:false, // 兑换优惠券成功提示
  174. ExchangeCouponData:{} // 兑换优惠券信息
  175. }
  176. },
  177. onLoad(option){//商品数据
  178. let data = JSON.parse(option.data);
  179. if(option.type =='prodcut'){
  180. this.cartType = 2
  181. this.productCount = data.data.productCount
  182. this.productIds = data.data.productID
  183. }else{
  184. this.cartType = 1
  185. this.productCount = data.data.productCount
  186. this.productIds = data.data.productID
  187. }
  188. this.$api.getStorage().then((resolve) =>{
  189. this.userID = resolve.userId ? resolve.userId : 0
  190. this.getInitCrearOrder();
  191. })
  192. },
  193. filters:{
  194. NumFormat(value) {//处理金额
  195. return Number(value).toFixed(2);
  196. },
  197. },
  198. methods: {
  199. getInitCrearOrder(){//获取订单商品信息
  200. this.OrderService.CreateOrderInfo({
  201. userId:this.userID,
  202. count:this.productCount,
  203. productIds:this.productIds,
  204. unionId:uni.getStorageSync('unionId')
  205. })
  206. .then(response =>{
  207. let resData = response.data
  208. this.isRequest = true
  209. this.goodsData = resData.list
  210. this.couponList = resData.couponList
  211. this.userMoney = resData.userMoney
  212. this.totalDiscountAmount = this.reducedPrice = resData.reducedPrice
  213. this.allPrice = this.payAllPrice = resData.totalPrice
  214. this.totalOriginalPrice = resData.totalOriginalPrice
  215. this.rechargeGoods = resData.rechargeGoods
  216. if(this.couponList.length>0){
  217. this.isCouponShow = true
  218. }
  219. })
  220. .catch(error =>{
  221. this.$util.msg(error.msg,2000)
  222. })
  223. },
  224. getFreightData(){//获取邮费信息
  225. this.isFreight = false
  226. let params ={
  227. userId:this.userID,
  228. productIds:this.productIds,
  229. totalPrice:this.allPrice,
  230. townId:this.addressData.townID
  231. }
  232. this.OrderService.GetOrderPostage(params).then(response =>{
  233. this.isFreight = true
  234. this.isCheckedBeans = false
  235. this.freightData = response.data
  236. this.hanldFreePostFlag = response.data.freePostFlag
  237. this.hanldFreight = response.data.freight
  238. if(this.hanldFreePostFlag == 1){
  239. if( this.freightData.userBeans > 0 ){
  240. this.freightBeansMoney = this.hanldFreight
  241. }else{
  242. this.freightBeansMoney = 0
  243. }
  244. this.payAllPrice = this.allPrice + response.data.freight
  245. this.attributePallPrice()
  246. this.hanldFreightBeans(this.isCheckedBeans)
  247. }else{
  248. if( this.freightData.userBeans > 0 ){
  249. this.freightBeansMoney = 30
  250. }else{
  251. this.freightBeansMoney = 0
  252. }
  253. this.payAllPrice = this.allPrice
  254. this.attributePallPrice()
  255. this.hanldFreightBeans(this.isCheckedBeans)
  256. }
  257. })
  258. },
  259. getAddressData(){//获取地址信息
  260. this.$api.getStorage().then((resolve) => {
  261. this.UserService.QueryAddressList({pageNum:1,pageSize:1,userID:resolve.userId}).then(response =>{
  262. this.isAddress = true
  263. this.addressData = {}
  264. if(response.data.results != ''){
  265. this.addressID = response.data.results[0].addressID;
  266. this.townID = response.data.results[0].townID;
  267. this.addressData = response.data.results[0];
  268. this.getFreightData()
  269. }else{
  270. this.addressData = this.addressData;
  271. }
  272. })
  273. })
  274. },
  275. handChangeInputGoodsList(data){//对应供应商的留言信息
  276. this.goodsData = data;
  277. },
  278. handleChoiceaInvoiceData(data){//获取发票信息
  279. this.invoiceData = data
  280. },
  281. hanldFreightFn(data){//显示邮费弹窗
  282. console.log(data)
  283. switch(data.freePostFlag){
  284. case 1:
  285. this.hanldFreight = this.freightData.freight
  286. this.hanldFreePostFlag = data.freePostFlag
  287. this.freightBeansMoney = data.freightBeansMoney
  288. this.payAllPrice =this.allPrice + this.hanldFreight
  289. this.attributePallPrice()
  290. this.hanldFreightBeans(this.isCheckedBeans)
  291. break
  292. case -1:
  293. this.hanldFreight = 0
  294. this.hanldFreePostFlag = data.freePostFlag
  295. this.freightBeansMoney = data.freightBeansMoney
  296. this.payAllPrice = this.allPrice
  297. this.attributePallPrice()
  298. this.hanldFreightBeans(this.isCheckedBeans)
  299. break
  300. }
  301. },
  302. hanldFreightBeans(data){//是否勾选采美豆抵扣
  303. this.isCheckedBeans = data;
  304. if(this.isCheckedBeans){
  305. // 判断如果采美豆大于等于运费*100
  306. if( this.freightData.userBeans > 0 ){
  307. this.hanldUserBeans = this.freightBeansMoney*100
  308. }else{
  309. this.hanldUserBeans = 0
  310. }
  311. // 计算抵扣后的总价
  312. if(this.hanldFreePostFlag == 1){
  313. // 如果使用了余额 最终价格
  314. if(this.ischecked){
  315. if(this.userMoney>=this.payAllPrice){
  316. this.payAllPrice = 0.00
  317. this.deductMoney = this.allPrice // 当前使用金额等于订单金额
  318. this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
  319. }else{
  320. this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
  321. this.deductMoney = this.userMoney // 当前使用金额等于总余额
  322. this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
  323. }
  324. }else{
  325. this.payAllPrice = this.allPrice + this.hanldFreight - this.freightBeansMoney - this.couponAmount
  326. }
  327. console.log('抵扣',this.payAllPrice)
  328. }
  329. }else{// 采美豆不抵扣运费
  330. this.hanldUserBeans = 0
  331. // 不抵扣时计算总价
  332. if(this.hanldFreePostFlag == 1){
  333. this.attributeHashfreight(this.hanldFreight)
  334. }
  335. }
  336. },
  337. handleChoiceaCouponData(data){// 勾选使用优惠券
  338. console.log('优惠券信息',data)
  339. this.couponAmount = data.couponAmount
  340. this.totalDiscountAmount = this.reducedPrice + this.couponAmount;
  341. this.clubCouponId = data.clubCouponId
  342. this.attributePallPrice()
  343. this.hanldFreightBeans(this.isCheckedBeans)
  344. },
  345. checkedBalabce(){//勾选使用余额
  346. if(this.userMoney > 0){
  347. this.ischecked = !this.ischecked
  348. if(this.ischecked){
  349. this.balanceDeductionFlag =1
  350. this.attributePallPrice()
  351. }else{
  352. if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){ //如果是有运费时
  353. if(this.isCheckedBeans){
  354. this.payAllPrice = this.allPrice - this.couponAmount
  355. }else{
  356. this.payAllPrice = this.allPrice+parseInt(this.freightData.freight) - this.couponAmount
  357. }
  358. }else{
  359. this.payAllPrice = this.allPrice - this.couponAmount
  360. }
  361. this.balanceDeductionFlag = 2
  362. }
  363. console.log('this.payAllPrice',this.payAllPrice)
  364. console.log('this.couponAmount',this.couponAmount)
  365. }else{
  366. return
  367. }
  368. },
  369. attributePallPrice(){// 计算价格
  370. if(this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1'){
  371. this.attributeHashfreight(this.freightData.freight)
  372. }else{
  373. this.attributeNofreight()
  374. }
  375. },
  376. attributeNofreight(){// 计算没有邮费的支付价格
  377. if(this.ischecked){
  378. if(this.userMoney>=this.payAllPrice){
  379. this.payAllPrice = 0.00
  380. this.deductMoney = this.allPrice // 当前使用金额等于订单金额
  381. this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额-当前使用金额
  382. }else{
  383. this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额-账户余额
  384. this.deductMoney = this.userMoney // 当前使用金额等于总余额
  385. this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
  386. }
  387. }else{
  388. this.payAllPrice = this.allPrice - this.couponAmount;
  389. this.deductMoney = 0.00; // 当前使用
  390. this.surplusMoney = this.userMoney; // 剩余余额
  391. }
  392. console.log('this.payAllPrice',this.payAllPrice)
  393. console.log('this.couponAmount',this.couponAmount)
  394. },
  395. attributeHashfreight(freight){// 计算需要邮费的支付价格
  396. this.payAllPrice = this.allPrice+parseInt(freight)// 计算不包邮的价格 总价等于商品价格+邮费
  397. if(this.ischecked){
  398. if(this.userMoney>=this.payAllPrice){// 全部抵扣
  399. this.payAllPrice =0.00
  400. if(this.isCheckedBeans){// 抵扣运费了
  401. this.deductMoney = this.allPrice // 当前使用金额等于订单金额
  402. this.surplusMoney = this.userMoney - this.deductMoney // 剩余金额等于余额减去当前使用金额
  403. }else{
  404. this.deductMoney = this.allPrice + parseInt(freight) // 当前使用金额等于订单金额+运费金额
  405. this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于总余额-当前使用金额
  406. }
  407. }else{// 部分抵扣
  408. if(this.isCheckedBeans){// 抵扣运费了
  409. this.payAllPrice = this.allPrice - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额+运费-账户余额
  410. this.deductMoney = this.userMoney // 当前使用金额等于账户余额
  411. this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
  412. }else{
  413. this.payAllPrice = this.allPrice+parseInt(freight) - this.userMoney - this.couponAmount // 订单最终支付金额等于订单金额+运费-账户余额
  414. this.deductMoney = this.userMoney // 当前使用金额等于账户余额
  415. this.surplusMoney = this.userMoney - this.deductMoney // 剩余余额等于账户余额-当前使用金额
  416. }
  417. }
  418. }else{
  419. this.payAllPrice = this.allPrice+parseInt(freight) - this.couponAmount
  420. this.deductMoney = 0.00 // 当前使用金额
  421. this.surplusMoney = this.userMoney // 剩余余额
  422. }
  423. console.log('this.payAllPrice',this.payAllPrice)
  424. console.log('this.couponAmount',this.couponAmount)
  425. },
  426. orderSubmitMit(){// 提交订单
  427. if(this.isSubLoading){ return; }
  428. if(this.addressID == ''){
  429. this.$util.msg('请先添加收货地址~',2000)
  430. return
  431. }
  432. this.orderInfo = this.goodsData.map(el => {
  433. let productInfo = [];
  434. el.cartList.forEach(item => {
  435. productInfo.push({
  436. productId:item.productId,
  437. productNum:item.number,
  438. presentNum:0,
  439. productType:item.productType
  440. })
  441. })
  442. return {shopId:el.id,note:el.note?el.note:'',productInfo:productInfo}
  443. })
  444. //订单信息
  445. this.payInfo = {
  446. clauseId:0,//条款(暂时保留)
  447. orderShouldPayFee:this.payAllPrice.toFixed(2),//提交的总价
  448. balancePayFlag:this.balanceDeductionFlag,//余额抵扣的状态
  449. freight:parseInt(this.hanldFreight).toFixed(2),//邮费
  450. freePostFlag:parseInt(this.hanldFreePostFlag),//运费形式
  451. userBeans:this.hanldUserBeans
  452. }
  453. let param = {
  454. clubCouponId:this.clubCouponId,
  455. orderSource:6,
  456. clubUserId:this.userID,
  457. cartType:this.cartType,
  458. addressId:this.addressID,
  459. orderInfo:this.orderInfo,
  460. payInfo:this.payInfo, //订单信息
  461. orderInvoice:this.invoiceData
  462. }
  463. console.log(param)
  464. this.isSubLoading = true;
  465. this.OrderService.CreatedOrderSubmit({'params':JSON.stringify(param)}).then(response =>{
  466. const data = response.data;
  467. // 友盟埋点收集机构自主提交订单
  468. if(process.env.NODE_ENV != 'development'){
  469. this.$uma.trackEvent('Um_Event_ConfirmOrder', {
  470. Um_Key_PageName: '机构提交订单',
  471. Um_Key_SourcePage: '确认订单',
  472. Um_Key_OrderID:`${data.orderID}`
  473. })
  474. }
  475. if(data.code === '1'){
  476. this.submitState ='success'
  477. setTimeout(()=>{
  478. this.isSubLoading = false;
  479. },2000)
  480. let data = {orderID:response.data.orderID}
  481. this.$api.navigateTo(`/pages/user/order/success?data=${JSON.stringify({data:data})}`)
  482. }else{
  483. this.submitState ='confirm'
  484. this.$util.msg('订单提交成功',3000,true,'success')
  485. setTimeout(()=>{
  486. this.isSubLoading = false;
  487. },2000)
  488. setTimeout(()=>{
  489. this.$api.redirectTo(`/pages/user/order/order-payment?type=${this.submitState}&orderID=${response.data.orderID}`)
  490. },3000)
  491. }
  492. }).catch(error =>{
  493. this.$util.msg(error.msg,3000);
  494. })
  495. },
  496. handFreightAlertShow(){//显示邮费弹窗
  497. this.isfreightTip = true;
  498. },
  499. handleClickCancel(){// 关闭优惠券弹窗
  500. this.isCouponModel = false;
  501. this.getInitCrearOrder();
  502. },
  503. hideFreight(){//关闭邮费弹窗
  504. this.isfreightTip = false;
  505. },
  506. },
  507. onShow() {
  508. // this.addressID = ''
  509. let pages = getCurrentPages();
  510. let currPage = pages[pages.length-1];
  511. if(currPage.data.select =='select'){
  512. this.isAddress = true
  513. let SelectData = uni.getStorageSync('selectAddress');
  514. this.addressID = SelectData.addressID;
  515. this.addressData = SelectData
  516. this.getFreightData()
  517. }else{
  518. this.getAddressData()
  519. }
  520. }
  521. }
  522. </script>
  523. <style lang="scss">
  524. page {
  525. height: auto;
  526. background:#F7F7F7;
  527. }
  528. .btn-hover{
  529. background: #FFFFFF;
  530. }
  531. .animation{
  532. /* transition: transform 0.3s ease;*/
  533. transition-property: transform;
  534. transition-duration: 0.3s;
  535. transition-timing-function: ease;
  536. }
  537. .order{
  538. padding-bottom: 134rpx;
  539. }
  540. .invoice-freight{
  541. width: 702rpx;
  542. padding: 0 24rpx;
  543. height: auto;
  544. font-size: $font-size-28;
  545. color: $text-color;
  546. background: #FFFFFF;
  547. float: left;
  548. font-weight: bold;
  549. }
  550. .invoice-balance{
  551. width: 702rpx;
  552. height: auto;
  553. padding:0 24rpx;
  554. background: #FFFFFF;
  555. float: left;
  556. margin-top: 24rpx;
  557. margin-bottom: 24rpx;
  558. .balabce-t{
  559. width: 100%;
  560. height: 86rpx;
  561. line-height: 86rpx;
  562. font-size: $font-size-28;
  563. color: $text-color;
  564. float: left;
  565. .balabce-t-le{
  566. float: left;
  567. font-weight: bold;
  568. }
  569. .balabce-t-ri{
  570. float: right;
  571. display: flex;
  572. align-items: center;
  573. .money{
  574. display: flex;
  575. float: left;
  576. }
  577. .checkbox-box{
  578. display: flex;
  579. width: 60rpx;
  580. float: left;
  581. height: 100%;
  582. font-size: $font-size-24;
  583. .checkbox{
  584. width: 40rpx;
  585. text-align: right;
  586. box-sizing: border-box;
  587. text-align: center;
  588. text-decoration: none;
  589. border-radius: 0;
  590. -webkit-tap-highlight-color: transparent;
  591. overflow: hidden;
  592. color: $color-system;
  593. }
  594. }
  595. }
  596. }
  597. .balabce-b{
  598. width: 100%;
  599. float: left;
  600. overflow: hidden;
  601. .balabce-b-text{
  602. width: 100%;
  603. line-height: 58rpx;
  604. font-size: $font-size-24;
  605. color: #FF2A2A;
  606. text-align: right;
  607. float: right;
  608. }
  609. &.balabce-b--hide {
  610. padding: 0 0;
  611. height: 0px;
  612. line-height: 0px;
  613. }
  614. }
  615. }
  616. .footer{
  617. position: fixed;
  618. left: 0;
  619. bottom: 0;
  620. display: flex;
  621. align-items: center;
  622. width: 100%;
  623. height: 110rpx;
  624. line-height: 110rpx;
  625. justify-content: space-between;
  626. font-size: $font-size-28;
  627. background-color: #FFFFFF;
  628. z-index: 990;
  629. color: $text-color;
  630. .footer-le{
  631. width:570rpx;
  632. height:100%;
  633. float: left;
  634. }
  635. .footer-count{
  636. float: left;
  637. padding-left: 24rpx;
  638. width:180rpx;
  639. box-sizing: border-box;
  640. }
  641. .footer-price{
  642. width:370rpx;
  643. float: right;
  644. text-align: right;
  645. color: $text-color;
  646. padding: 10rpx 20rpx 10rpx 0;
  647. box-sizing: border-box;
  648. .sum-none{
  649. width: 100%;
  650. height: 45rpx;
  651. line-height: 45rpx;
  652. color: $text-color;
  653. float: left;
  654. text-align: right;
  655. .money{
  656. font-size: $font-size-26;
  657. color: #999999;
  658. text-decoration: line-through;
  659. }
  660. .money-sign{
  661. font-size: $font-size-26;
  662. color: #999999;
  663. text-decoration: line-through;
  664. }
  665. .money-reduced{
  666. margin-left: 10rpx;
  667. font-size: $font-size-26;
  668. color:#FF2A2A;
  669. }
  670. }
  671. .sum{
  672. width: 100%;
  673. height: 45rpx;
  674. line-height: 45rpx;
  675. float: left;
  676. &.none{
  677. height: 90rpx;
  678. line-height: 90rpx;
  679. }
  680. .price{
  681. font-size: $font-size-32;
  682. color: #FF2A2A;
  683. }
  684. }
  685. }
  686. .footer-submit{
  687. display:flex;
  688. align-items:center;
  689. justify-content: center;
  690. width: 180rpx;
  691. height: 100%;
  692. box-sizing: border-box;
  693. padding: 15rpx 5rpx;
  694. .btn{
  695. width: 100%;
  696. height: 100%;
  697. color: #FFFFFF;
  698. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  699. font-size: $font-size-26;
  700. text-align: center;
  701. line-height: 80rpx;
  702. border-radius: 40rpx;
  703. &.disabled{
  704. background: #e4e8eb;
  705. color: #999999;
  706. }
  707. }
  708. }
  709. }
  710. .coupon-content-model{
  711. width: 100%;
  712. height: 100%;
  713. background: rgba(0,0,0,.5);
  714. position: fixed;
  715. top: 0;
  716. left: 0;
  717. z-index: 8888;
  718. transition: all 0.4s;
  719. .coupon-alert-content{
  720. width: 600rpx;
  721. height: 612rpx;
  722. position: absolute;
  723. top: 0;
  724. left: 0;
  725. bottom: 0;
  726. right: 0;
  727. margin: auto;
  728. box-sizing: border-box;
  729. padding-top: 92rpx;
  730. .coupon{
  731. width: 600rpx;
  732. height: 522rpx;
  733. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  734. background-size: cover;
  735. box-sizing: border-box;
  736. padding: 230rpx 40rpx 0 40rpx;
  737. .coupon-list{
  738. width: 100%;
  739. height: 147rpx;
  740. margin-bottom: 32rpx;
  741. box-sizing: border-box;
  742. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  743. background-size: cover;
  744. position: relative;
  745. .list-cell-tags{
  746. display: inline-block;
  747. padding: 0 10rpx;
  748. height: 32rpx;
  749. line-height: 32rpx;
  750. background-color: #f94b4b;
  751. color: #FFFFFF;
  752. font-size: 18rpx;
  753. border-radius: 16rpx 0 16rpx 0;
  754. text-align: center;
  755. position: absolute;
  756. top: 0;
  757. left: 0;
  758. }
  759. .list-cell-le{
  760. width: 154rpx;
  761. height: 100%;
  762. box-sizing: border-box;
  763. padding: 30rpx 0;
  764. float: left;
  765. .coupon-maxMoney{
  766. width: 100%;
  767. height: 54rpx;
  768. line-height: 54rpx;
  769. font-size: 42rpx;
  770. color: #f94b4b;
  771. text-align: center;
  772. margin-top: 10rpx;
  773. .small{
  774. font-size: $font-size-20;
  775. }
  776. }
  777. .coupon-minMoney{
  778. width: 100%;
  779. height: 28rpx;
  780. float: left;
  781. box-sizing: border-box;
  782. padding-left: 24rpx;
  783. .txt{
  784. display: block;
  785. height: 28rpx;
  786. line-height: 28rpx;
  787. font-size: 16rpx;
  788. color: #f94b4b;
  789. text-align: center;
  790. padding: 0 5rpx;
  791. background-color: #fff1eb;
  792. border-radius: 4rpx;
  793. float: left;
  794. }
  795. }
  796. }
  797. .list-cell-ri{
  798. width: 366rpx;
  799. height: 100%;
  800. box-sizing: border-box;
  801. padding:30rpx 20rpx;
  802. float: left;
  803. .list-cell-top{
  804. width: 100%;
  805. height: 64rpx;
  806. line-height: 64rpx;
  807. font-size: $font-size-26;
  808. color: #333333;
  809. float: left;
  810. }
  811. .list-cell-time{
  812. width: 100%;
  813. height: 28rpx;
  814. line-height: 28rpx;
  815. text-align: left;
  816. font-size: $font-size-20;
  817. color: #999999;
  818. }
  819. }
  820. }
  821. .coupon-btn{
  822. width: 100%;
  823. height: 78rpx;
  824. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  825. background-size: cover;
  826. line-height: 78rpx;
  827. text-align: center;
  828. color: #FFFFFF;
  829. font-size: $font-size-36;
  830. }
  831. }
  832. }
  833. }
  834. </style>