create-order.vue 28 KB

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