orderDetail.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361
  1. <template>
  2. <view class="container">
  3. <view class="order-type-info">
  4. <view class="order-type-title">{{orderType.title}}</view>
  5. <view class="order-type-text">{{orderType.text}}
  6. </view>
  7. </view>
  8. <view class="address-info-box">
  9. <view class="address-icon">
  10. <text class="iconfont icondizhi"></text>
  11. </view>
  12. <view class="address-content">
  13. <text class="address-info">
  14. <text class="address-name">{{orderData.recName}}</text>
  15. <text class="address-phone">{{orderData.recMobile}}</text>
  16. </text>
  17. <view class="address-detail">{{orderData.address}}</view>
  18. </view>
  19. </view>
  20. <view class="goods-info-box">
  21. <view class="shop-info" @click.stop="gotoShop()">
  22. <text class="iconfont icondianpu"></text>
  23. <text class="shop-name">{{orderData.merchantInfoResVO.supplierName}}</text>
  24. <text class="iconfont iconfangxiang" v-if="orderData.tenantCode != 'admin'"></text>
  25. </view>
  26. <view class="goods-list">
  27. <view class="goods-row" v-for="(item, index) in orderData.merchantInfoResVO.products" :key="index">
  28. <image class="goods-img" :src="item.imgUrl" mode="aspectFill"></image>
  29. <view class="goods-info">
  30. <view class="goods-name">{{item.productName}}</view>
  31. <view class="goods-type">
  32. 类型:{{item.productType == 1 ? '普通商品' : (item.productType == 2 ? '拍卖商品' : (item.productType == 3 ? '自助采摘' : '共享种植'))}}
  33. </view>
  34. <view class="plant-area" v-if="item.productType == 4">面积:{{item.areaSize}}㎡</view>
  35. <view class="goods-price-number">
  36. <text class="goods-unit">¥</text>
  37. <text class="goods-price">{{item.bizPrice}}</text>
  38. <text class="goods-number">x{{item.buyNum}}</text>
  39. <text class="plant-text" v-if="item.productType == 4">有效期:{{item.term}}天</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="order-info">
  45. <u-cell-group :border="false">
  46. <u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
  47. <u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
  48. <u-cell-item title="优惠券" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
  49. <u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
  50. </u-cell-group>
  51. </view>
  52. <view class="pay-info">
  53. <text class="pay-text">实付款</text>
  54. <text class="pay-price">¥{{orderData.paySum}}</text>
  55. </view>
  56. </view>
  57. <view class="order-info-box" @click="goToMessage()">
  58. <view class="info-title-box">
  59. <view class="info-title">留言板</view>
  60. <text class="iconfont iconfangxiang"></text>
  61. </view>
  62. <view class="info-content-box">
  63. <view class="message-row" v-for="(item, index1) in orderData.leas" :key="index1">
  64. <image class="message-head" :src="item.headImg" mode="aspectFill"></image>
  65. <view class="message-info-box">
  66. <view class="message-name">{{item.name}}</view>
  67. <view class="message-date">{{item.leaMsgTime}}</view>
  68. <view class="message-text">{{item.leaMsgContent}}</view>
  69. <!-- <view class="message-img-box" v-for="(site, index2) in item.orderLeaImgResVOs" :key="index2">
  70. <image class="message-img" :src="site.imgUrl" mode="aspectFill"></image>
  71. </view> -->
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="order-info-box">
  77. <view class="info-title-box">
  78. <view class="info-title">订单信息</view>
  79. </view>
  80. <view class="info-content-box">
  81. <view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
  82. <view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
  83. <view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime ? orderData.payTime : orderData.addOrderTime}}</view>
  84. <view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6 && orderData.orderStatus != 4">发货时间:{{orderData.sendTime ? orderData.sendTime : '-'}}</view>
  85. <view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6 && orderData.orderStatus != 4">收货时间:{{orderData.confirmTime ? orderData.sendTime : '-'}}</view>
  86. <view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
  87. </view>
  88. </view>
  89. <view class="order-info-box" v-if="orderData.evaluateResVO && orderData.evaluateResVO.evaluateContent">
  90. <view class="info-title-box">
  91. <view class="info-title">评价信息</view>
  92. </view>
  93. <view class="info-content-box">
  94. <view class="assess-row">
  95. <image class="assess-head" mode="aspectFill" :src="orderData.merchantInfoResVO.headImg"></image>
  96. <view class="assess-info">
  97. <view class="assess-name">{{orderData.nickname}}</view>
  98. <view class="assess-date">{{orderData.evaluateResVO.evaluateTime ? orderData.evaluateResVO.evaluateTime : ''}}</view>
  99. <view class="assess-sore-box">
  100. <u-rate v-model="orderData.evaluateResVO.score" active-color="#FFAE21" disabled></u-rate>
  101. </view>
  102. <view class="assess-text">{{orderData.evaluateResVO.evaluateContent ? orderData.evaluateResVO.evaluateContent : '暂无评价'}}</view>
  103. <view class="assess-img-box">
  104. <image class="img-col" mode="aspectFill" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs"
  105. :key="i" @tap="_previewImage(item.imgUrl,i)"></image>
  106. </view>
  107. </view>
  108. <view class="shop-reply-box" v-if="orderData.evaluateResVO.replyContent">
  109. <view class="shop-head">
  110. <view class="iconfont icondianpu"></view>
  111. <view class="shop-name">店家回复</view>
  112. </view>
  113. <view class="shop-reply">{{orderData.evaluateResVO.replyContent}}</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <!-- </view> -->
  119. <uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup" />
  120. <u-modal v-model="modalShow" :content="modalContent" @confirm="submitHandle" :async-close="true" :show-cancel-button="true"></u-modal>
  121. <u-top-tips ref="uTips"></u-top-tips>
  122. <view class="uni-popup-dialog" :hidden="show_qx">
  123. <view class="uni-dialog-title">
  124. <text class="uni-dialog-title-text">提示</text>
  125. </view>
  126. <view class="uni-dialog-content">
  127. <text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
  128. </view>
  129. <view class="uni-dialog-button-group">
  130. <button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
  131. 设置权限
  132. </button>
  133. </view>
  134. </view>
  135. <view class="qx_bg" :hidden="show_qx">
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. const NET = require('@/utils/request')
  141. const API = require('@/config/api')
  142. export default {
  143. components: {},
  144. data() {
  145. return {
  146. show_qx: true,
  147. orderType: {
  148. title: '',
  149. text: '',
  150. },
  151. orderData: {
  152. orderId: '',
  153. addOrderTime: '',
  154. recName: '',
  155. recMobile: '',
  156. address: '',
  157. merchantInfoResVO: {
  158. supplierName: '',
  159. products: [],
  160. },
  161. evaluateResVO: {},
  162. orderSum: 0,
  163. integralAmount: 0,
  164. couponDiscountAmount: 0,
  165. notes: 'xxxxx',
  166. paySum: 0,
  167. leas: [],
  168. orderCode: '',
  169. payTime: '',
  170. sendTime: '',
  171. confirmTime: '',
  172. cancelTime: '',
  173. tenantCode: '',
  174. evaluateReplyStatus: 1,
  175. },
  176. goodType: 1, // 1是普通商品类型;3是包含自助采摘+普通商品的类型;2是拍卖、共享种植
  177. buttonGroup: [],
  178. modalShow: false,
  179. handleType: '',
  180. modalContent: '',
  181. }
  182. },
  183. onLoad(options) {
  184. this.userData = uni.getStorageSync("userData")
  185. NET.request(API.getOrderDetail, {
  186. flag: 1,
  187. orderId: options.orderId,
  188. orderStatus: options.orderStatus,
  189. }, 'GET').then(res => {
  190. this.orderData = res.data
  191. if (this.orderData.addOrderTime) {
  192. let tempTime = new Date(this.orderData.addOrderTime.replace(/\-/g, '/')).getTime()
  193. let addTempTime = new Date(tempTime + 1000 * 60 * 60 * 24)
  194. let addYear = addTempTime.getFullYear()
  195. let addMonth = addTempTime.getMonth() + 1
  196. let addDay = addTempTime.getDate()
  197. let addHours = addTempTime.getHours()
  198. let addMin = addTempTime.getMinutes()
  199. let addSeconds = addTempTime.getSeconds()
  200. this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' +
  201. addSeconds
  202. // this.orderData.tempTimeArr = this.orderData.addOrderTime.split(' ')
  203. // let tempDate = new Date(this.orderData.tempTimeArr[0].replace(/-/g, "/"))
  204. // this.orderData.overTime = new Date(tempDate.setDate(tempDate.getDate() + 1))
  205. }
  206. // 1是普通商品类型;3是包含自助采摘+普通商品的类型;2是拍卖、共享种植
  207. if (this.orderData.merchantInfoResVO.products.length) {
  208. if (this.orderData.merchantInfoResVO.products.every(v => {
  209. return (v.productType == 1)
  210. })) {
  211. this.goodType = 1
  212. } else if (this.orderData.merchantInfoResVO.products.some(v => {
  213. return (v.productType == 3)
  214. })) {
  215. this.goodType = 3
  216. } else if (this.orderData.merchantInfoResVO.products[0].productType == 2 || this.orderData.merchantInfoResVO.products[
  217. 0].productType == 4) {
  218. this.goodType = 2
  219. }
  220. }
  221. // if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
  222. // 2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
  223. // debugger
  224. // if (this.orderData.merchantInfoResVO.products.some(v=>{v.productType == 3})) {
  225. // this.goodType = 3
  226. // } else {
  227. // this.goodType = 1
  228. // }
  229. // } else {
  230. // this.goodType = 2
  231. // }
  232. switch (JSON.stringify(this.orderData.orderStatus)) {
  233. case '1':
  234. if (this.goodType == 3) {
  235. this.buttonGroup = [{
  236. text: '取消订单',
  237. backgroundColor: '#75BD60',
  238. color: '#fff'
  239. }, {
  240. text: '立即支付',
  241. backgroundColor: '#52A63A',
  242. color: '#fff'
  243. }, {
  244. text: '自助采摘',
  245. backgroundColor: '#75BD60',
  246. color: '#fff'
  247. }]
  248. } else {
  249. this.buttonGroup = [{
  250. text: '取消订单',
  251. backgroundColor: '#75BD60',
  252. color: '#fff'
  253. }, {
  254. text: '立即支付',
  255. backgroundColor: '#52A63A',
  256. color: '#fff'
  257. }]
  258. }
  259. break;
  260. case '2':
  261. var someVaule = this.orderData.merchantInfoResVO.products.some(v => {
  262. Number(v.productType)
  263. return v.productType == 1
  264. })
  265. if (!someVaule) {
  266. if (this.orderData.merchantInfoResVO.products.every(v => {
  267. Number(v.productType)
  268. return v.productType == 3
  269. })) {
  270. this.buttonGroup = [{
  271. text: '申请售后',
  272. backgroundColor: '#75BD60',
  273. color: '#fff'
  274. }, {
  275. text: '自助采摘',
  276. backgroundColor: '#52A63A',
  277. color: '#fff'
  278. }]
  279. } else {
  280. this.buttonGroup = [{
  281. text: '申请售后',
  282. backgroundColor: '#75BD60',
  283. color: '#fff'
  284. }]
  285. }
  286. } else {
  287. this.buttonGroup = [{
  288. text: '申请售后',
  289. backgroundColor: '#75BD60',
  290. color: '#fff'
  291. }]
  292. }
  293. break;
  294. case '3':
  295. this.buttonGroup = [{
  296. text: '申请售后',
  297. backgroundColor: '#52A63A',
  298. color: '#fff'
  299. }, {
  300. text: '确认收货',
  301. backgroundColor: '#52A63A',
  302. color: '#fff'
  303. }, {
  304. text: '追踪物流',
  305. backgroundColor: '#52A63A',
  306. color: '#fff'
  307. }]
  308. break;
  309. case '4':
  310. if (this.orderData.merchantInfoResVO.products.every(v => {
  311. Number(v.productType)
  312. return v.productType == 4
  313. })) {
  314. this.buttonGroup = [{
  315. text: '申请售后',
  316. backgroundColor: '#75BD60',
  317. color: '#fff'
  318. }, {
  319. text: '我的种植',
  320. backgroundColor: '#52A63A',
  321. color: '#fff'
  322. }]
  323. } else {
  324. this.buttonGroup = [{
  325. text: '申请售后',
  326. backgroundColor: '#75BD60',
  327. color: '#fff'
  328. }]
  329. }
  330. break;
  331. default:
  332. this.buttonGroup = [{
  333. text: '申请售后',
  334. backgroundColor: '#52A63A',
  335. color: '#fff'
  336. }]
  337. }
  338. if (this.orderData.orderStatus == 4 && this.orderData.evaluateReplyStatus == 1) {
  339. if (this.orderData.orderType != 3 && this.orderData.orderType != 4)
  340. this.buttonGroup.push({
  341. text: '评价',
  342. backgroundColor: '#52A63A',
  343. color: '#fff'
  344. })
  345. }
  346. this.getOrderType()
  347. }).catch(error => {
  348. this.$refs.uTips.show({
  349. title: error.data.msg,
  350. type: 'warning',
  351. })
  352. })
  353. // this.getOrderType()
  354. },
  355. onShow() {},
  356. methods: {
  357. closeSetting: function() {
  358. this.show_qx = true;
  359. },
  360. // 获取订单类型
  361. getOrderType() {
  362. if (!this.orderData.auctionStatus) {
  363. switch (this.orderData.orderStatus) {
  364. case 1:
  365. this.orderType = {
  366. title: '等待买家付款',
  367. text: '订单将于' + this.orderData.overTime + '关闭',
  368. date: this.orderData.overTime
  369. }
  370. break;
  371. case 2:
  372. this.orderType = {
  373. title: '等待卖家发货',
  374. text: '您的商品正在打包等待发货',
  375. }
  376. break;
  377. case 3:
  378. this.orderType = {
  379. title: '等待商品送达',
  380. text: '您的商品已发出正在路上,请耐心等待',
  381. }
  382. break;
  383. case 4:
  384. this.orderType = {
  385. title: '商品已送达',
  386. text: '',
  387. }
  388. break;
  389. case 5:
  390. this.orderType = {
  391. title: '交易已完成',
  392. text: '',
  393. }
  394. break;
  395. default:
  396. this.orderType = {
  397. title: '交易已取消',
  398. text: '',
  399. }
  400. }
  401. } else {
  402. switch (this.orderData.auctionStatus) {
  403. case 1:
  404. this.orderType = {
  405. title: '竞拍中',
  406. text: '',
  407. }
  408. break;
  409. case 2:
  410. switch (this.orderData.orderStatus) {
  411. case 2:
  412. this.orderType = {
  413. title: '竞拍成功-等待卖家发货',
  414. text: '您的商品正在打包等待发货',
  415. }
  416. break;
  417. case 3:
  418. this.orderType = {
  419. title: '竞拍成功-等待商品送达',
  420. text: '您的商品已发出正在路上,请耐心等待',
  421. }
  422. break;
  423. case 4:
  424. this.orderType = {
  425. title: '竞拍成功-商品已送达',
  426. text: '',
  427. }
  428. break;
  429. case 5:
  430. this.orderType = {
  431. title: '竞拍成功-交易已完成',
  432. text: '',
  433. }
  434. break;
  435. }
  436. break;
  437. case 3:
  438. this.orderType = {
  439. title: '竞拍失败',
  440. text: '',
  441. }
  442. break;
  443. }
  444. }
  445. },
  446. // 操作
  447. orderHandle(e) {
  448. if (this.orderData.orderStatus == 1) {
  449. if (e.index == 0) {
  450. // 取消订单
  451. this.modalContent = '请确定是否取消订单'
  452. this.handleType = 1
  453. this.modalShow = true
  454. } else if (e.index == 1) {
  455. // 立即支付
  456. this.modalContent = '请确定是否立即支付'
  457. this.handleType = 2
  458. this.modalShow = true
  459. } else if (e.index == 2) {
  460. // 跳转自助采摘
  461. this.goPickVideo()
  462. }
  463. } else {
  464. if (e.index == 0) {
  465. // 申请售后
  466. NET.request(API.applyService, {
  467. tenantCode: this.orderData.tenantCode
  468. }, 'GET').then(res => {
  469. uni.makePhoneCall({
  470. phoneNumber: res.data.contactTel
  471. });
  472. }).catch(error => {
  473. this.$refs.uTips.show({
  474. title: error.data.msg,
  475. type: 'warning',
  476. })
  477. })
  478. } else {
  479. if (this.orderData.orderStatus == 2) {
  480. // 自助采摘
  481. this.goPickVideo()
  482. } else if (this.orderData.orderStatus == 3) {
  483. if (e.index == 1) {
  484. // 确认收货
  485. this.modalContent = '请确定是否确认收货'
  486. this.handleType = 3
  487. this.modalShow = true
  488. } else {
  489. // 追踪物流
  490. uni.navigateTo({
  491. url: '/pagesMain/logisticsDeatil?logisticCode=' + this.orderData.logisticsNum
  492. });
  493. }
  494. } else if (this.orderData.orderStatus == 4) {
  495. if (e.index == 1 && this.goodType == 2) {
  496. // 去我的种植
  497. uni.navigateTo({
  498. url: '/pagesGood/goodDetails?minePlant=true&goodId=' + this.orderData.merchantInfoResVO.products[0].productId +
  499. '&orderId=' + this.orderData.orderId
  500. });
  501. } else {
  502. // 评价
  503. uni.navigateTo({
  504. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode +
  505. '&productIds=' + this.orderData.merchantInfoResVO.products.map(site => {
  506. return site.productId
  507. }).join(',')
  508. });
  509. }
  510. } else {
  511. // 评价
  512. uni.navigateTo({
  513. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode +
  514. '&productIds=' + this.orderData.merchantInfoResVO.products.map(site => {
  515. return site.productId
  516. }).join(',')
  517. });
  518. }
  519. }
  520. }
  521. },
  522. // 状态流转
  523. submitHandle() {
  524. if (this.handleType == 1) {
  525. // 取消订单
  526. NET.request(API.cancelOrder, {
  527. orderId: this.orderData.orderId
  528. }, 'GET').then(res => {
  529. this.modalShow = false
  530. this.$refs.uTips.show({
  531. title: '取消订单成功',
  532. type: 'success',
  533. })
  534. setTimeout(() => {
  535. uni.reLaunch({
  536. url: '/pagesMain/orderList?type=' + 1
  537. });
  538. }, 1000)
  539. }).catch(error => {
  540. this.modalShow = false
  541. this.$refs.uTips.show({
  542. title: error.data.msg,
  543. type: 'warning',
  544. })
  545. })
  546. } else if (this.handleType == 2) {
  547. // 立即支付
  548. NET.request(API.payOrder, {
  549. mid: uni.getStorageSync("userData").userId,
  550. orderCode: this.orderData.orderCode,
  551. orderId: this.orderData.orderId,
  552. // #ifdef APP-PLUS
  553. channel: 2
  554. //#endif
  555. }, 'POST').then(res => {
  556. this.modalShow = false
  557. // #ifdef MP-WEIXIN
  558. uni.requestPayment({
  559. provider: 'wxpay',
  560. timeStamp: res.data.timeStamp,
  561. nonceStr: res.data.nonceStr,
  562. package: res.data.packageValue,
  563. signType: res.data.signType,
  564. paySign: res.data.paySign,
  565. success: (payRes) => {
  566. console.log('success:' + JSON.stringify(payRes));
  567. // if (this.goodType == 3) {
  568. // uni.navigateTo({
  569. // url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
  570. // });
  571. // } else {
  572. uni.navigateTo({
  573. url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
  574. });
  575. // }
  576. },
  577. fail: (error) => {
  578. console.log('fail:' + JSON.stringify(error));
  579. this.$refs.uTips.show({
  580. title: '支付失败',
  581. type: 'warning',
  582. })
  583. }
  584. })
  585. //#endif
  586. // #ifdef APP-PLUS
  587. uni.requestPayment({
  588. provider: 'wxpay',
  589. orderInfo: {
  590. "package": res.data.packageValue,
  591. "appid": res.data.appId,
  592. "sign": res.data.sign,
  593. "partnerid": res.data.partnerId,
  594. "prepayid": res.data.prepayId,
  595. "noncestr": res.data.nonceStr,
  596. "timestamp": res.data.timeStamp,
  597. },
  598. success: (payRes) => {
  599. console.log('success:' + JSON.stringify(payRes));
  600. uni.navigateTo({
  601. url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
  602. });
  603. },
  604. fail: (error) => {
  605. console.log('fail:' + JSON.stringify(error));
  606. this.$refs.uTips.show({
  607. title: '支付失败',
  608. type: 'warning',
  609. })
  610. }
  611. })
  612. // #endif
  613. }).catch(error => {
  614. this.modalShow = false
  615. this.$refs.uTips.show({
  616. title: error.data.msg,
  617. type: 'warning',
  618. })
  619. })
  620. // setTimeout(() => {
  621. // uni.reLaunch({
  622. // url: '/pagesMain/orderList?type=' + 3
  623. // });
  624. // }, 1000)
  625. } else if (this.handleType == 3) {
  626. // 确认收货
  627. NET.request(API.confirmOrder, {
  628. orderId: this.orderData.orderId
  629. }, 'GET').then(res => {
  630. this.modalShow = false
  631. this.$refs.uTips.show({
  632. title: '确认收货成功',
  633. type: 'success',
  634. })
  635. setTimeout(() => {
  636. uni.reLaunch({
  637. url: '/pagesMain/orderList?type=' + 5
  638. });
  639. }, 1000)
  640. }).catch(error => {
  641. this.modalShow = false
  642. this.$refs.uTips.show({
  643. title: error.data.msg,
  644. type: 'warning',
  645. })
  646. })
  647. }
  648. },
  649. // 跳转自助采摘直播
  650. goPickVideo() {
  651. var that = this;
  652. if (uni.getStorageSync("firstTimeLiveUser") == "") {
  653. uni.setStorage({
  654. key: 'firstTimeLiveUser',
  655. data: 1
  656. })
  657. uni.navigateTo({
  658. url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
  659. });
  660. } else {
  661. uni.navigateTo({
  662. url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
  663. });
  664. }
  665. },
  666. // 跳转留言列表
  667. goToMessage() {
  668. uni.navigateTo({
  669. url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
  670. });
  671. },
  672. // 跳转商铺
  673. gotoShop() {
  674. if (this.orderData.tenantCode != 'admin') {
  675. if (this.orderData.merchantInfoResVO.products.length) {
  676. uni.navigateTo({
  677. url: '/pagesGood/shopDetails?goodId=' + this.orderData.merchantInfoResVO.products[0].productId
  678. });
  679. }
  680. }
  681. },
  682. // 图片预览
  683. _previewImage(image, index) {
  684. var imgArr = [];
  685. imgArr.push(image);
  686. //预览图片
  687. uni.previewImage({
  688. urls: imgArr,
  689. current: imgArr[index]
  690. });
  691. }
  692. }
  693. }
  694. </script>
  695. <style>
  696. page {
  697. background-color: #f7f7f7;
  698. }
  699. </style>
  700. <style lang="less" scoped>
  701. page {
  702. width: 100%;
  703. height: 100%;
  704. }
  705. .container {
  706. width: 100%;
  707. height: 100%;
  708. float: left;
  709. background-color: #f7f7f7;
  710. // box-sizing: border-box;
  711. padding-bottom: 50px;
  712. overflow-y: auto;
  713. .order-type-info {
  714. width: 100%;
  715. height: 115px;
  716. float: left;
  717. box-sizing: border-box;
  718. padding: 22px 100px 0 15px;
  719. background: #52A63A;
  720. border-radius: 0px 0px 20px 20px;
  721. background-size: 62px;
  722. background-position: calc(100% - 48px) 12px;
  723. background-repeat: no-repeat;
  724. background-image: url(@/static/images/orderDetail.png);
  725. .order-type-title {
  726. width: 100%;
  727. float: left;
  728. height: 20px;
  729. line-height: 20px;
  730. font-size: 15px;
  731. font-family: PingFang SC;
  732. color: #FFFFFF;
  733. margin-bottom: 4px;
  734. }
  735. .order-type-text {
  736. width: 100%;
  737. float: left;
  738. height: 20px;
  739. line-height: 20px;
  740. font-size: 12px;
  741. font-family: PingFang SC;
  742. color: #FFFFFF;
  743. }
  744. }
  745. .address-info-box {
  746. width: calc(100% - 30px);
  747. float: left;
  748. box-sizing: border-box;
  749. padding: 16px 18px 16px 16px;
  750. margin: -34px 15px 10px 15px;
  751. background: #FFFFFF;
  752. border-radius: 10px;
  753. .address-icon {
  754. width: 36px;
  755. height: 40px;
  756. float: left;
  757. align-items: center;
  758. display: flex;
  759. .iconfont {
  760. color: #52A63A;
  761. font-size: 36px;
  762. }
  763. }
  764. .address-content {
  765. width: calc(100% - 56px);
  766. height: 40px;
  767. float: left;
  768. margin: 0 8px 0 12px;
  769. .address-info {
  770. height: 20px;
  771. font-family: PingFang SC;
  772. line-height: 20px;
  773. overflow: hidden;
  774. text-overflow: ellipsis;
  775. white-space: nowrap;
  776. .address-name {
  777. font-size: 16px;
  778. color: #333333;
  779. margin-right: 14px;
  780. }
  781. .address-phone {
  782. font-size: 12px;
  783. color: #666666;
  784. }
  785. }
  786. .address-detail {
  787. height: 20px;
  788. font-size: 16px;
  789. font-family: PingFang SC;
  790. color: #333333;
  791. line-height: 20px;
  792. overflow: hidden;
  793. text-overflow: ellipsis;
  794. white-space: nowrap;
  795. }
  796. }
  797. }
  798. .goods-info-box {
  799. width: calc(100% - 30px);
  800. float: left;
  801. margin: 0 15px 10px 15px;
  802. background: #FFFFFF;
  803. border-radius: 10px;
  804. .shop-info {
  805. width: 100%;
  806. height: 48px;
  807. float: left;
  808. box-sizing: border-box;
  809. padding: 13px 15px 12px 15px;
  810. border-bottom: 1px solid #EEEEEE;
  811. line-height: 22px;
  812. .icondianpu {
  813. font-size: 22px;
  814. color: #333333;
  815. }
  816. .shop-name {
  817. font-size: 15px;
  818. font-family: PingFang SC;
  819. color: #333333;
  820. margin: 0 8px 0 10px;
  821. }
  822. .iconshangjia {
  823. font-size: 12px;
  824. color: #999999;
  825. }
  826. }
  827. .goods-list {
  828. width: 100%;
  829. float: left;
  830. box-sizing: border-box;
  831. padding: 10px 15px 0 15px;
  832. .goods-row {
  833. width: 100%;
  834. height: 90px;
  835. float: left;
  836. display: flex;
  837. margin-bottom: 10px;
  838. .goods-img {
  839. width: 90px;
  840. height: 90px;
  841. border-radius: 5px;
  842. object-fit: cover;
  843. }
  844. .goods-info {
  845. width: calc(100% - 106px);
  846. height: 90px;
  847. margin-left: 16px;
  848. .goods-name {
  849. width: 100%;
  850. height: 36px;
  851. float: left;
  852. font-size: 14px;
  853. font-family: PingFang SC;
  854. color: #333333;
  855. line-height: 18px;
  856. overflow: hidden;
  857. text-overflow: ellipsis;
  858. display: -webkit-box;
  859. -webkit-line-clamp: 2;
  860. -webkit-box-orient: vertical;
  861. word-wrap: break-word;
  862. }
  863. .goods-type {
  864. height: 20px;
  865. float: left;
  866. background: #F0F0F0;
  867. border-radius: 4px;
  868. padding: 0 8px;
  869. margin: 6px 0;
  870. font-size: 10px;
  871. font-family: PingFang SC;
  872. color: #666666;
  873. line-height: 20px;
  874. }
  875. .plant-area {
  876. height: 20px;
  877. float: right;
  878. margin: 6px 0;
  879. font-size: 12px;
  880. font-family: PingFang SC;
  881. color: #333333;
  882. }
  883. .goods-price-number {
  884. width: 100%;
  885. height: 20px;
  886. float: left;
  887. line-height: 20px;
  888. font-family: PingFang SC;
  889. color: #333333;
  890. .goods-unit {
  891. font-size: 12px;
  892. }
  893. .goods-price {
  894. font-size: 15px;
  895. margin-right: 6px;
  896. }
  897. .goods-number {
  898. font-size: 12px;
  899. }
  900. }
  901. .plant-text {
  902. float: right;
  903. font-size: 12px;
  904. font-family: PingFang SC;
  905. color: #333333;
  906. }
  907. }
  908. }
  909. }
  910. .order-info {
  911. width: 100%;
  912. float: left;
  913. /deep/.u-cell {
  914. padding: 6px 16px;
  915. }
  916. }
  917. .pay-info {
  918. width: 100%;
  919. height: 46px;
  920. float: left;
  921. box-sizing: border-box;
  922. border-top: 1px solid #EEEEEE;
  923. padding-right: 15px;
  924. line-height: 44px;
  925. font-family: PingFang SC;
  926. font-size: 14px;
  927. text-align: right;
  928. white-space: nowrap;
  929. .pay-text {
  930. float: left;
  931. color: #333333;
  932. margin-left: 15px;
  933. }
  934. .pay-price {
  935. color: #52A63A;
  936. }
  937. }
  938. }
  939. .order-info-box {
  940. width: calc(100% - 30px);
  941. float: left;
  942. margin: 0 15px 10px 15px;
  943. background: #FFFFFF;
  944. border-radius: 10px;
  945. .info-title-box {
  946. width: 100%;
  947. height: 48px;
  948. float: left;
  949. box-sizing: border-box;
  950. padding: 15px 15px 14px 15px;
  951. border-bottom: 1px solid #EEEEEE;
  952. line-height: 18px;
  953. white-space: nowrap;
  954. .info-title {
  955. height: 18px;
  956. float: left;
  957. font-size: 15px;
  958. font-family: PingFang SC;
  959. color: #333333;
  960. margin-right: 8px;
  961. padding-left: 10px;
  962. border-left: 2px solid #74BD60;
  963. }
  964. .iconfangxiang {
  965. float: right;
  966. font-size: 12px;
  967. color: #999999;
  968. }
  969. }
  970. .info-content-box {
  971. width: 100%;
  972. float: left;
  973. padding: 15px 0;
  974. .message-row {
  975. width: 100%;
  976. float: left;
  977. box-sizing: border-box;
  978. padding: 0 15px;
  979. margin-bottom: 15px;
  980. .message-head {
  981. width: 50px;
  982. height: 50px;
  983. object-fit: cover;
  984. float: left;
  985. border-radius: 50%;
  986. overflow: hidden;
  987. }
  988. .message-info-box {
  989. width: calc(100% - 75px);
  990. float: right;
  991. .message-name {
  992. width: 50%;
  993. height: 30px;
  994. float: left;
  995. font-size: 15px;
  996. font-family: PingFang SC;
  997. color: #333333;
  998. line-height: 30px;
  999. overflow: hidden;
  1000. text-overflow: ellipsis;
  1001. white-space: nowrap;
  1002. }
  1003. .message-date {
  1004. width: 50%;
  1005. height: 30px;
  1006. float: left;
  1007. font-size: 12px;
  1008. font-family: PingFang SC;
  1009. color: #666666;
  1010. text-align: right;
  1011. line-height: 30px;
  1012. overflow: hidden;
  1013. text-overflow: ellipsis;
  1014. white-space: nowrap;
  1015. }
  1016. .message-text {
  1017. width: 100%;
  1018. height: 20px;
  1019. float: left;
  1020. font-size: 12px;
  1021. font-family: PingFang SC;
  1022. color: #666666;
  1023. line-height: 20px;
  1024. overflow: hidden;
  1025. text-overflow: ellipsis;
  1026. white-space: nowrap;
  1027. }
  1028. .message-img-box {
  1029. width: 100%;
  1030. float: left;
  1031. .message-img {
  1032. width: 76px;
  1033. height: 76px;
  1034. object-fit: cover;
  1035. float: left;
  1036. margin: 0 10px 10px 0;
  1037. }
  1038. }
  1039. }
  1040. }
  1041. .message-row:last-child {
  1042. margin-bottom: 0;
  1043. }
  1044. .order-info-row {
  1045. width: 100%;
  1046. float: left;
  1047. box-sizing: border-box;
  1048. padding: 0 15px;
  1049. font-size: 12px;
  1050. font-family: PingFang SC;
  1051. color: #333333;
  1052. line-height: 26px;
  1053. word-break: break-all;
  1054. }
  1055. }
  1056. .assess-row {
  1057. width: calc(100% - 30px);
  1058. margin: 0 15px;
  1059. float: left;
  1060. // border-top: 1px solid #F6F6F6;
  1061. padding: 12px 0;
  1062. .assess-head {
  1063. width: 50px;
  1064. height: 50px;
  1065. float: left;
  1066. object-fit: cover;
  1067. border-radius: 50%;
  1068. }
  1069. .assess-info {
  1070. width: calc(100% - 62px);
  1071. margin-left: 12px;
  1072. float: left;
  1073. .assess-name {
  1074. height: 18px;
  1075. float: left;
  1076. line-height: 18px;
  1077. font-size: 15px;
  1078. font-family: PingFang SC;
  1079. font-weight: bold;
  1080. color: #343434;
  1081. }
  1082. .assess-date {
  1083. height: 18px;
  1084. float: right;
  1085. line-height: 18px;
  1086. font-size: 12px;
  1087. font-family: PingFang SC;
  1088. font-weight: bold;
  1089. color: #666666;
  1090. }
  1091. .assess-sore-box {
  1092. width: 100%;
  1093. height: 16px;
  1094. float: left;
  1095. margin: 6px 0;
  1096. }
  1097. .assess-text {
  1098. width: 100%;
  1099. float: left;
  1100. font-size: 12px;
  1101. font-family: PingFang SC;
  1102. font-weight: bold;
  1103. color: #666666;
  1104. line-height: 16px;
  1105. margin: 8px 0 10px 0;
  1106. overflow: hidden;
  1107. text-overflow: ellipsis;
  1108. display: -webkit-box;
  1109. -webkit-line-clamp: 2;
  1110. -webkit-box-orient: vertical;
  1111. word-wrap: break-word;
  1112. }
  1113. .assess-img-box {
  1114. width: 100%;
  1115. float: left;
  1116. display: flex;
  1117. .img-col {
  1118. height: 60px;
  1119. width: 60px;
  1120. object-fit: cover;
  1121. margin: 0 10px 10px 0;
  1122. }
  1123. }
  1124. }
  1125. .shop-reply-box {
  1126. width: 100%;
  1127. float: left;
  1128. background: #F5F5F5;
  1129. border-radius: 5px;
  1130. margin-top: 10px;
  1131. .shop-head {
  1132. width: 100%;
  1133. height: 36px;
  1134. float: left;
  1135. box-sizing: border-box;
  1136. padding: 10px 12px;
  1137. .icondianpu {
  1138. width: 16px;
  1139. height: 16px;
  1140. float: left;
  1141. color: #52A63A;
  1142. font-size: 20px;
  1143. margin-right: 8px;
  1144. }
  1145. .shop-name {
  1146. height: 16px;
  1147. float: left;
  1148. font-size: 15px;
  1149. font-family: PingFang SC;
  1150. color: #52A63A;
  1151. line-height: 16px;
  1152. }
  1153. }
  1154. .shop-reply {
  1155. width: 100%;
  1156. float: left;
  1157. box-sizing: border-box;
  1158. padding: 0 12px 12px 12px;
  1159. font-size: 12px;
  1160. font-family: PingFang SC;
  1161. color: #666666;
  1162. line-height: 16px;
  1163. }
  1164. }
  1165. }
  1166. }
  1167. .order-handle {
  1168. width: 100%;
  1169. height: 50px;
  1170. float: left;
  1171. border-top: 1px solid #cccccc;
  1172. position: fixed;
  1173. bottom: 0;
  1174. left: 0;
  1175. }
  1176. }
  1177. .uni-popup-dialog {
  1178. width: 80vw;
  1179. border-radius: 15px;
  1180. background-color: #fff;
  1181. position: fixed;
  1182. margin-left: 10vw;
  1183. top: 34vh;
  1184. z-index: 1001;
  1185. }
  1186. .uni-dialog-title {
  1187. /* #ifndef APP-NVUE */
  1188. display: flex;
  1189. /* #endif */
  1190. flex-direction: row;
  1191. justify-content: center;
  1192. padding-top: 15px;
  1193. padding-bottom: 5px;
  1194. }
  1195. .uni-dialog-title-text {
  1196. font-size: 16px;
  1197. font-weight: 500;
  1198. }
  1199. .uni-dialog-content {
  1200. /* #ifndef APP-NVUE */
  1201. display: flex;
  1202. /* #endif */
  1203. flex-direction: row;
  1204. justify-content: center;
  1205. align-items: center;
  1206. padding: 5px 15px 15px 15px;
  1207. text-align: center;
  1208. }
  1209. .uni-dialog-content-text {
  1210. font-size: 14px;
  1211. color: #6e6e6e;
  1212. }
  1213. .uni-dialog-button-group {
  1214. /* #ifndef APP-NVUE */
  1215. display: flex;
  1216. /* #endif */
  1217. flex-direction: row;
  1218. border-top-color: #f5f5f5;
  1219. border-top-style: solid;
  1220. border-top-width: 1px;
  1221. }
  1222. .uni-dialog-button {
  1223. /* #ifndef APP-NVUE */
  1224. display: flex;
  1225. /* #endif */
  1226. background: rgba(0, 0, 0, 0);
  1227. border: none;
  1228. flex: 1;
  1229. flex-direction: row;
  1230. justify-content: center;
  1231. align-items: center;
  1232. height: 45px;
  1233. }
  1234. .uni-border-left {
  1235. border-left-color: #f0f0f0;
  1236. border-left-style: solid;
  1237. border-left-width: 0px;
  1238. }
  1239. .uni-dialog-button-text {
  1240. font-size: 14px;
  1241. }
  1242. .uni-button-color {
  1243. color: #007aff;
  1244. }
  1245. .uni-dialog-input {
  1246. flex: 1;
  1247. font-size: 14px;
  1248. }
  1249. .uni-popup__success {
  1250. color: #4cd964;
  1251. }
  1252. .uni-popup__warn {
  1253. color: #f0ad4e;
  1254. }
  1255. .uni-popup__error {
  1256. color: #dd524d;
  1257. }
  1258. .uni-popup__info {
  1259. color: #909399;
  1260. }
  1261. .qx_bg {
  1262. width: 100vw;
  1263. height: 100vh;
  1264. background: rgba(0, 0, 0, 0.25);
  1265. position: fixed;
  1266. top: 0px;
  1267. left: 0px;
  1268. z-index: 1000;
  1269. }
  1270. /deep/.uni-tab__cart-button-right {
  1271. border-right: 1px solid #ffffff;
  1272. }
  1273. /deep/.uni-tab__cart-button-right:last-child {
  1274. border-right: none;
  1275. }
  1276. </style>