create-order.vue 29 KB

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