create-order.vue 28 KB

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