create-order.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  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.isCouponShow = true
  292. if(this.couponList.length>0){
  293. this.couponAmount = data.couponList[0].couponAmount
  294. this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
  295. }
  296. this.orderShouldPayFee = this.allPrice - this.couponAmount
  297. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  298. this.goodsData.forEach(item =>{
  299. item.cartList.forEach(pros =>{
  300. if(this.depositIds.indexOf(pros.productId)>=0){
  301. this.isDepositFlg = false
  302. }else{
  303. this.isDepositFlg = true
  304. }
  305. })
  306. })
  307. this.getAddressData()
  308. }).catch(error =>{
  309. this.$util.msg(error.msg,2000)
  310. })
  311. },
  312. getInitProdcutCrearOrder(){//二手下单初始化查询
  313. this.seconDepositFlg = false
  314. this.SellerService.GetSettlementBySencondProduct(this.productParam).then(response =>{
  315. const data = response.data
  316. this.isRequest = true
  317. this.goodsData = data.list
  318. this.userMoney = data.userMoney
  319. this.totalCount = data.totalCount
  320. this.allPrice = data.totalPrice
  321. this.orderShouldPayFee = this.allPrice
  322. this.isCouponShow = false
  323. this.secondflag = false
  324. this.getAddressData()
  325. }).catch(error =>{
  326. this.$util.msg(error.msg,2000)
  327. })
  328. },
  329. // 获取订单商品id列表
  330. getProductIds(list){
  331. const productIds = []
  332. list.forEach(function(supplier){
  333. supplier.cartList.forEach(function(product){
  334. productIds.push(product.productId)
  335. })
  336. })
  337. // console.log(list);
  338. return productIds.join(',')
  339. },
  340. getFreightData(){//获取邮费信息
  341. this.OrderService.GetOrderPostage(this.postageParam).then(response =>{
  342. let data = response.data
  343. this.freightData = data
  344. this.isFreight = true
  345. console.log('this.freightData',this.freightData)
  346. if(data.postageFlag== 1){
  347. this.orderShouldPayFee = this.allPrice + data.postage
  348. this.attributePallPrice()
  349. }else{
  350. this.orderShouldPayFee = this.allPrice
  351. this.attributePallPrice()
  352. }
  353. })
  354. },
  355. async getAddressData(){//获取地址信息
  356. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  357. this.UserService.QueryAddressList(
  358. {
  359. pageNum:1,
  360. pageSize:1,
  361. userId:clubInfo.userId,
  362. }
  363. ).then(response =>{
  364. let data = response.data
  365. this.isAddress = true
  366. this.addressData = {}
  367. if(response.data.results != ''){
  368. this.confirmParam.addressId = data.list[0].addressId
  369. this.postageParam.townId = data.list[0].townId
  370. this.addressData = data.list[0]
  371. this.getFreightData()
  372. }else{
  373. this.addressData = this.addressData
  374. }
  375. })
  376. },
  377. handChangeInputGoodsList(data){//对应供应商的留言信息
  378. this.goodsData = data
  379. },
  380. handleChoiceaInvoiceData(data){//获取发票信息
  381. this.confirmParam.orderInvoice = data
  382. },
  383. handleChoiceaFreightData(data){//获取运费信息
  384. if(data.postageFlag == 1){
  385. this.freightData = data
  386. this.orderShouldPayFee = this.allPrice + parseInt(data.postage)
  387. this.attributePallPrice()
  388. }else{
  389. this.freightData = data
  390. this.orderShouldPayFee = this.allPrice
  391. this.attributePallPrice()
  392. }
  393. },
  394. handleClauseData(clauseId){// 条款Id
  395. this.confirmParam.payInfo.clauseId = parseInt(clauseId)
  396. },
  397. handleChoiceaCouponData(data){// 勾选使用优惠券
  398. console.log('优惠券信息',data)
  399. this.couponAmount = data.couponAmount
  400. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  401. this.clubCouponId = data.clubCouponId
  402. this.attributePallPrice()
  403. },
  404. checkedBalabce(){//勾选使用余额
  405. if(this.userMoney > 0){
  406. this.ischecked = !this.ischecked
  407. if(this.ischecked){
  408. this.confirmParam.payInfo.balancePayFlag = 1
  409. this.attributePallPrice()
  410. }else{
  411. this.confirmParam.payInfo.balancePayFlag = 0
  412. if( this.freightData.postageFlag == 1 ){
  413. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  414. }else{
  415. this.orderShouldPayFee = this.allPrice - this.couponAmount
  416. }
  417. }
  418. console.log('最终订单支付金额',this.orderShouldPayFee)
  419. console.log('优惠券金额',this.couponAmount)
  420. }else{
  421. return
  422. }
  423. },
  424. attributePallPrice(){//计算价格
  425. if( this.freightData.postageFlag == 1){
  426. this.attributeHashfreight(this.freightData.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.freightData.postage).toFixed(2)
  502. this.confirmParam.payInfo.postageFlag = parseInt(this.freightData.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.confirmParam.payInfo.rebateFlag=1
  536. }else{
  537. this.confirmParam.payInfo.rebateFlag=0
  538. }
  539. console.log(this.confirmParam.payInfo.rebateFlag)
  540. },
  541. handFreightAlertShow(){//显示邮费弹窗
  542. this.isfreightTip = true
  543. },
  544. handleClickCancel(){// 关闭优惠券弹窗
  545. this.isCouponModel = false
  546. this.getInitCrearOrder()
  547. },
  548. hideFreight(){//关闭邮费弹窗
  549. this.isfreightTip = false
  550. },
  551. hideMobel() {
  552. this.modal = false
  553. },
  554. },
  555. onShow() {
  556. let pages = getCurrentPages()
  557. let currPage = pages[pages.length-1]
  558. if(currPage.data.select =='select'){
  559. this.isAddress = true
  560. let SelectData = uni.getStorageSync('selectAddress')
  561. this.confirmParam.addressId = SelectData.addressId
  562. this.postageParam.townId = SelectData.townId
  563. this.addressData = SelectData
  564. this.getFreightData()
  565. }else{
  566. this.getAddressData()
  567. }
  568. }
  569. }
  570. </script>
  571. <style lang="scss">
  572. page {
  573. height: auto;
  574. background:#F7F7F7;
  575. }
  576. .btn-hover{
  577. background: #FFFFFF;
  578. }
  579. .animation{
  580. /* transition: transform 0.3s ease;*/
  581. transition-property: transform;
  582. transition-duration: 0.3s;
  583. transition-timing-function: ease;
  584. }
  585. .invoice-freight{
  586. width: 702rpx;
  587. padding: 0 24rpx;
  588. height: 86rpx;
  589. line-height: 86rpx;
  590. font-size: $font-size-28;
  591. color: $text-color;
  592. background: #FFFFFF;
  593. float: left;
  594. font-weight: bold;
  595. .freight-left{
  596. float: left;
  597. .icon-yunfeishuoming{
  598. height: 100%;
  599. padding: 0 15rpx;
  600. color: $color-system;
  601. font-weight: normal;
  602. }
  603. }
  604. .freight-right{
  605. float: right;
  606. color: #2A81FF;
  607. }
  608. }
  609. .invoice-balance{
  610. width: 702rpx;
  611. height: auto;
  612. padding:0 24rpx;
  613. background: #FFFFFF;
  614. float: left;
  615. margin-top: 24rpx;
  616. margin-bottom: 24rpx;
  617. .balabce-t{
  618. width: 100%;
  619. height: 86rpx;
  620. line-height: 86rpx;
  621. font-size: $font-size-28;
  622. color: $text-color;
  623. float: left;
  624. .balabce-t-le{
  625. float: left;
  626. font-weight: bold;
  627. }
  628. .balabce-t-ri{
  629. float: right;
  630. display: flex;
  631. align-items: center;
  632. .money{
  633. display: flex;
  634. float: left;
  635. }
  636. .checkbox-box{
  637. display: flex;
  638. width: 60rpx;
  639. float: left;
  640. height: 100%;
  641. font-size: $font-size-24;
  642. .checkbox{
  643. width: 40rpx;
  644. text-align: right;
  645. box-sizing: border-box;
  646. text-align: center;
  647. text-decoration: none;
  648. border-radius: 0;
  649. -webkit-tap-highlight-color: transparent;
  650. overflow: hidden;
  651. color: $color-system;
  652. padding: 5rpx;
  653. }
  654. }
  655. }
  656. }
  657. .balabce-b{
  658. width: 100%;
  659. float: left;
  660. overflow: hidden;
  661. .balabce-b-text{
  662. width: 100%;
  663. line-height: 58rpx;
  664. font-size: $font-size-24;
  665. color: #FF2A2A;
  666. text-align: right;
  667. float: right;
  668. }
  669. &.balabce-b--hide {
  670. padding: 0 0;
  671. height: 0px;
  672. line-height: 0px;
  673. }
  674. }
  675. }
  676. .footer{
  677. position: fixed;
  678. left: 0;
  679. bottom: 0;
  680. display: flex;
  681. align-items: center;
  682. width: 100%;
  683. height: 110rpx;
  684. line-height: 110rpx;
  685. justify-content: space-between;
  686. font-size: $font-size-28;
  687. background-color: #FFFFFF;
  688. z-index: 990;
  689. color: $text-color;
  690. .footer-le{
  691. width:570rpx;
  692. height:100%;
  693. float: left;
  694. }
  695. .footer-count{
  696. float: left;
  697. padding-left: 24rpx;
  698. width:190rpx;
  699. box-sizing: border-box;
  700. font-size: $font-size-26;
  701. }
  702. .footer-price{
  703. width:370rpx;
  704. float: right;
  705. text-align: right;
  706. color: $text-color;
  707. padding: 10rpx 20rpx 10rpx 0;
  708. box-sizing: border-box;
  709. .sum-none{
  710. width: 100%;
  711. height: 45rpx;
  712. line-height: 45rpx;
  713. color: $text-color;
  714. float: left;
  715. text-align: right;
  716. .money{
  717. font-size: $font-size-26;
  718. color: #999999;
  719. text-decoration: line-through;
  720. }
  721. .money-sign{
  722. font-size: $font-size-26;
  723. color: #999999;
  724. text-decoration: line-through;
  725. }
  726. .money-reduced{
  727. margin-left: 10rpx;
  728. font-size: $font-size-26;
  729. color:$color-system;
  730. }
  731. }
  732. .sum{
  733. width: 100%;
  734. height: 45rpx;
  735. line-height: 45rpx;
  736. float: left;
  737. &.none{
  738. height: 90rpx;
  739. line-height: 90rpx;
  740. }
  741. .price{
  742. font-size: $font-size-32;
  743. color: #FF2A2A;
  744. }
  745. }
  746. }
  747. .footer-submit{
  748. display:flex;
  749. align-items:center;
  750. justify-content: center;
  751. width: 180rpx;
  752. height: 100%;
  753. box-sizing: border-box;
  754. padding: 15rpx 5rpx;
  755. .btn{
  756. width: 100%;
  757. height: 100%;
  758. color: #FFFFFF;
  759. background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
  760. font-size: $font-size-26;
  761. text-align: center;
  762. line-height: 80rpx;
  763. border-radius: 40rpx;
  764. &.disabled{
  765. background: #e4e8eb;
  766. color: #999999;
  767. }
  768. }
  769. }
  770. }
  771. .Rebate{
  772. width: 702rpx;
  773. height: auto;
  774. padding: 0 24rpx;
  775. background: #FFFFFF;
  776. float: left;
  777. margin-bottom: 24rpx;
  778. margin-top: 24rpx;
  779. line-height: 86rpx;
  780. .rebate-title{
  781. float: left;
  782. font-weight: bold;
  783. color: #333333;
  784. font-size: $font-size-28;
  785. }
  786. .iconfont{
  787. float: right;
  788. color: #b2b2b2;
  789. font-size: 40rpx;
  790. &.icon-yixuanze{
  791. color: $color-system;
  792. }
  793. }
  794. }
  795. .coupon-content-model{
  796. width: 100%;
  797. height: 100%;
  798. background: rgba(0,0,0,.5);
  799. position: fixed;
  800. top: 0;
  801. left: 0;
  802. z-index: 8888;
  803. transition: all 0.4s;
  804. .coupon-alert-content{
  805. width: 600rpx;
  806. height: 612rpx;
  807. position: absolute;
  808. top: 0;
  809. left: 0;
  810. bottom: 0;
  811. right: 0;
  812. margin: auto;
  813. box-sizing: border-box;
  814. padding-top: 92rpx;
  815. .coupon{
  816. width: 600rpx;
  817. height: 522rpx;
  818. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  819. background-size: cover;
  820. box-sizing: border-box;
  821. padding: 230rpx 40rpx 0 40rpx;
  822. .coupon-list{
  823. width: 100%;
  824. height: 147rpx;
  825. margin-bottom: 32rpx;
  826. box-sizing: border-box;
  827. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  828. background-size: cover;
  829. position: relative;
  830. .list-cell-tags{
  831. display: inline-block;
  832. padding: 0 10rpx;
  833. height: 32rpx;
  834. line-height: 32rpx;
  835. background-color: #f94b4b;
  836. color: #FFFFFF;
  837. font-size: 18rpx;
  838. border-radius: 16rpx 0 16rpx 0;
  839. text-align: center;
  840. position: absolute;
  841. top: 0;
  842. left: 0;
  843. }
  844. .list-cell-le{
  845. width: 154rpx;
  846. height: 100%;
  847. box-sizing: border-box;
  848. padding: 30rpx 0;
  849. float: left;
  850. .coupon-maxMoney{
  851. width: 100%;
  852. height: 54rpx;
  853. line-height: 54rpx;
  854. font-size: 42rpx;
  855. color: #f94b4b;
  856. text-align: center;
  857. margin-top: 10rpx;
  858. .small{
  859. font-size: $font-size-20;
  860. }
  861. }
  862. .coupon-minMoney{
  863. width: 100%;
  864. height: 28rpx;
  865. float: left;
  866. box-sizing: border-box;
  867. padding-left: 24rpx;
  868. .txt{
  869. display: block;
  870. height: 28rpx;
  871. line-height: 28rpx;
  872. font-size: 16rpx;
  873. color: #f94b4b;
  874. text-align: center;
  875. padding: 0 5rpx;
  876. background-color: #fff1eb;
  877. border-radius: 4rpx;
  878. float: left;
  879. }
  880. }
  881. }
  882. .list-cell-ri{
  883. width: 366rpx;
  884. height: 100%;
  885. box-sizing: border-box;
  886. padding:30rpx 20rpx;
  887. float: left;
  888. .list-cell-top{
  889. width: 100%;
  890. height: 64rpx;
  891. line-height: 64rpx;
  892. font-size: $font-size-26;
  893. color: #333333;
  894. float: left;
  895. text-overflow:ellipsis;
  896. display: -webkit-box;
  897. word-break: break-all;
  898. -webkit-box-orient: vertical;
  899. -webkit-line-clamp: 1;
  900. overflow: hidden;
  901. }
  902. .list-cell-time{
  903. width: 100%;
  904. height: 28rpx;
  905. line-height: 28rpx;
  906. text-align: left;
  907. font-size: $font-size-20;
  908. color: #999999;
  909. }
  910. }
  911. }
  912. .coupon-btn{
  913. width: 100%;
  914. height: 78rpx;
  915. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  916. background-size: cover;
  917. line-height: 78rpx;
  918. text-align: center;
  919. color: #FFFFFF;
  920. font-size: $font-size-36;
  921. }
  922. }
  923. }
  924. }
  925. </style>