OrderDetail.nvue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. <template>
  2. <view class="">
  3. <customNav :shownav="true" :title="i18n('index.orderxq')" titledetl=""></customNav>
  4. <weizhimap v-if="showMap==1" class="mapview" :style="'height:'+mapHeight+'rpx;'" :height="mapHeight" :covers="pcovers"></weizhimap>
  5. <view v-if="state==0" class="topActV">
  6. <view class="contentInRowC">
  7. <view class="actBTVS">
  8. <view v-if="orderxq.collectPayment==0" class="actbt" @click="choosebt(1)">
  9. <view class="ddbticon">
  10. <image class="bticon" src="/static/images/qzhifu@3x.png" mode="scaleToFill"></image>
  11. </view>
  12. <view class="ddtext">
  13. <text style="font-size: 32rpx;">{{i18n('order.quzhifu')}}</text>
  14. </view>
  15. </view>
  16. <view v-if="orderxq.collectPayment==1" class="actbt">
  17. <view class="ddbticon">
  18. <image class="bticon" src="/static/images/qzhifu@3x.png" mode="scaleToFill"></image>
  19. </view>
  20. <view class="ddtext">
  21. <text style="font-size: 32rpx;">{{i18n('index.huodaofukan')}}</text>
  22. </view>
  23. </view>
  24. <view class="actbt" @click="choosebt(3)">
  25. <view class="ddbticon">
  26. <image class="bticon" src="/static/images/quxiao@3x.png" mode="scaleToFill"></image>
  27. </view>
  28. <view class="ddtext">
  29. <text style="font-size: 32rpx;">{{i18n('order.quxiaodingdan')}}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <label class="linesp"></label>
  36. <view v-if="state>0" class="topActVB">
  37. <view class="actBTV">
  38. <view v-if="state==5" class="actbt" @click="choosebt(4)">
  39. <view class="ddbticon">
  40. <image class="bticon" src="/static/images/xiugai@3x.png" mode="scaleToFill" ></image>
  41. </view>
  42. <view class="ddtext">
  43. <text style="font-size: 32rpx;">{{i18n('order.fabiaopinglun')}}</text>
  44. </view>
  45. </view>
  46. <view v-if="isshouh(state)" class="actbt" >
  47. <view class="ddbticon" @click="choosebt(5)">
  48. <uni-icons custom-prefix="custom-icon" color="#386EF5" type="chat-filled" size="30"></uni-icons>
  49. </view>
  50. <view class="ddtext" @click="choosebt(5)">
  51. <text style="font-size: 32rpx;">{{i18n('order.lianxikef')}}</text>
  52. </view>
  53. </view>
  54. <view v-if="state==7&&orderxq.collectPayment!=1" class="actbt" >
  55. <view class="ddbticon" @click="quanertuikuan(11)">
  56. <image class="bticon" src="/static/images/payflact@3x.png" mode="scaleToFill"></image>
  57. </view>
  58. <view class="ddtext" @click="quanertuikuan(11)">
  59. <text style="font-size: 32rpx;">{{i18n('order.tongyituik')}}</text>
  60. </view>
  61. </view>
  62. <view v-if="isdaish(state)" class="actbt" @click="choosebt(7)">
  63. <view class="ddbticon">
  64. <uni-icons custom-prefix="custom-icon" color="#E02F73" type="closeempty" size="30"></uni-icons>
  65. </view>
  66. <view class="ddtext">
  67. <text style="font-size: 32rpx;">{{i18n('order.candianyw')}}</text>
  68. </view>
  69. </view>
  70. <view v-if="isdaish(state)" class="actbt" @click="choosebt(6)">
  71. <view class="ddbticon" >
  72. <uni-icons custom-prefix="custom-icon" color="#386EF5" type="checkmarkempty" size="30"></uni-icons>
  73. </view>
  74. <view class="ddtext">
  75. <text style="font-size: 32rpx;">{{i18n('order.wancheng')}}</text>
  76. </view>
  77. </view>
  78. <view class="actbt" >
  79. <view class="ddbticon" @click="callPhone">
  80. <image class="bticon" src="/static/images/kefu@3x.png" mode="scaleToFill" ></image>
  81. </view>
  82. <view class="ddtext" @click="callPhone">
  83. <text style="font-size: 30rpx;">{{i18n('order.lianxishj')}}</text>
  84. </view>
  85. </view>
  86. <view v-if="showMap==1" class="actbt">
  87. <view class="ddbticon" @click="reloadLocate">
  88. <image style="width: 80rpx;height: 80rpx;" src="/static/images/qishoutb@3x.png" mode="scaleToFill"></image>
  89. </view>
  90. <view class="ddtext" @click="reloadLocate">
  91. <text style="font-size: 32rpx;">{{i18n('order.shuaxin')}}</text>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <label class="linesp"></label>
  97. <scroll-view :style="'height:'+scrollHeight+'rpx;'" scroll-y="true">
  98. <view class="contentColumn" style="background-color: white;">
  99. <view class="contentInRowS spaceCtv">
  100. <view class="contentInRowL">
  101. <image style="width: 40rpx;height: 40rpx;" src="/static/images/shouye.png" mode="scaleToFill"></image>
  102. <text class="textfontB3">{{posName}}</text>
  103. </view>
  104. <text class="textfontB4">{{ordertypename}}</text>
  105. </view>
  106. <view class="contentInRowS spaceCtv" @click="lshxiugai()">
  107. <view class="contentInRowL">
  108. <text class="textfontB3">{{i18n('order.zhuangtai')}}</text>
  109. </view>
  110. <text class="textfontB4">{{stateName}}</text>
  111. </view>
  112. <view v-if="showMap==1" class="contentColumn">
  113. <view class="contentInRowS spaceCtvh">
  114. <view class="contentColumnC">
  115. <netImage bradius="8" width="90" height="90" :mysrc="orderxq.qsuser.avatar" mymode="scaleToFill"></netImage>
  116. <text style="font-size: 28rpx;">{{orderxq.qsuser.nickName}}</text>
  117. </view>
  118. <view class="contentColumnC" @click="phoneCall">
  119. <uni-icons custom-prefix="custom-icon" color="#386EF5" type="phone" size="28"></uni-icons>
  120. <text style="font-size: 28rpx;">phone</text>
  121. </view>
  122. <view class="contentColumnC" @click="audioCall">
  123. <uni-icons custom-prefix="custom-icon" color="#386EF5" type="phone-filled" size="28"></uni-icons>
  124. <text style="font-size: 28rpx;">IM Call</text>
  125. </view>
  126. <view class="contentColumnC" @click="exchange">
  127. <uni-icons custom-prefix="custom-icon" color="#386EF5" type="chatboxes" size="28"></uni-icons>
  128. <text style="font-size: 28rpx;">{{i18n('exchange.xinxi')}}</text>
  129. </view>
  130. </view>
  131. <view class="contentColumn">
  132. <view class="contentInRowL contentV" >
  133. <text style="font-size: 28rpx;">{{i18n('order.chepaihao')}}: </text>
  134. <text style="font-size: 28rpx;">{{orderxq.qsuser.licensePlate}}</text>
  135. </view>
  136. <view class="contentInRowL contentV" style="height: 50rpx;align-items: center;">
  137. <text style="font-size: 28rpx;">{{i18n('order.yishouli')}}</text>
  138. <progress :percent="jinduA" activeColor="#006AFF" stroke-width="4" />
  139. <text style="font-size: 28rpx;">{{i18n('order.peisong')}}</text>
  140. <progress :percent="jinduB" activeColor="#006AFF" stroke-width="5" />
  141. <text style="font-size: 28rpx;">{{i18n('order.yiwancheng')}}</text>
  142. </view>
  143. </view>
  144. <label class="linesp"></label>
  145. </view>
  146. <view v-for="item in food">
  147. <view class="spnodetail">
  148. <view class="">
  149. <netImage class="spIcon" width="90" height="90" :mysrc="item.image" mymode="scaleToFill"></netImage>
  150. </view>
  151. <view style="width: 600upx">
  152. <view class="contentInRowS">
  153. <text class="foodNameV">{{item.name}}</text>
  154. <text style="font-size: 28rpx;color: brown;margin-right: 30rpx;">X {{item.number}}</text>
  155. </view>
  156. <view class="contentInRowS">
  157. <text style="font-size: 26rpx;color: blueviolet;">{{i18n('shangpin.shoujia')}}: {{formPr(item.price+item.otherPrice)}}{{i18n('locale.huobidw')}}</text>
  158. <text class="xiaoji" style="font-size: 28rpx;color: brown;">{{i18n('shangpin.xiaoji')}}: {{formPr((item.price+item.otherPrice)*item.number)}}{{i18n('locale.huobidw')}}</text>
  159. </view>
  160. <view class="viewinrow" >
  161. <text class="kouweisku">{{arraytoStr(item.ask)}}</text>
  162. </view>
  163. <view v-if="item.beizhu" class="">
  164. <text style="font-size: 30rpx;color:#00A6FF;">{{item.beizhu}}</text>
  165. </view>
  166. </view>
  167. </view>
  168. <label class="linesp"></label>
  169. </view>
  170. <view v-if="orderxq.type==0" class="contentColumn spaceCtvauto" >
  171. <text class="textfontB4">{{i18n('index.peisongdizhi')}}</text>
  172. <text class="textfontS1 adrrTextV">{{address}}</text>
  173. </view>
  174. <view class="contentInRowS spaceCtv">
  175. <text class="textfontB4">{{i18n('order.shoujianren')}}</text>
  176. <text class="textfontB5">{{name}}</text>
  177. </view>
  178. <view class="contentInRowS spaceCtv">
  179. <text class="textfontB4">{{i18n('order.lianxidianhua')}}</text>
  180. <text class="textfontB5">{{phone}}</text>
  181. </view>
  182. <view class="contentInRowS spaceCtvN">
  183. <text class="textfontB4">{{i18n('order.yuyueshijian')}}</text>
  184. <text class="textfontB5">{{orderxq.delryTime}}</text>
  185. </view>
  186. <label class="linesp"></label>
  187. <view v-if="ordertype!=0">
  188. <view class="contentInRowS spaceCtv">
  189. <text class="textfontB4">{{i18n('order.mendiandiz')}}</text>
  190. <text class="textfontB5">{{address}}</text>
  191. </view>
  192. <view class="contentInRowS spaceCtv">
  193. <text class="textfontB4">{{i18n('order.lianxidianhua')}}</text>
  194. <text class="textfontB5">{{phone}}</text>
  195. </view>
  196. <view class="contentInRowS spaceCtvN">
  197. <text class="textfontB4">{{i18n('order.yuyueshijian')}}</text>
  198. <text class="textfontB5">{{orderxq.delryTime}}</text>
  199. </view>
  200. </view>
  201. <label class="linesp"></label>
  202. <view v-if="yhjinr>0" class="contentInRowS spaceCtv">
  203. <text class="textfontB4">{{i18n('index.youhuiq')}}</text>
  204. </view>
  205. <view v-if="yhjinr>0" class="contentColumn spaceCtvauto">
  206. <view v-if="orderxq.salesReduction" style="margin-top: 10rpx;">
  207. <text class="textfontB4" style="color: #00A6FF;">{{orderxq.salesName}}</text>
  208. <text class="textfontB4" style="color: #00A6FF;">{{orderxq.salesReduction}}{{i18n('locale.huobidw')}}</text>
  209. </view>
  210. <view v-if="orderxq.discountAmount" style="margin-top: 10rpx;">
  211. <text class="textfontB4" style="color: #00A6FF;">{{orderxq.yhName}}</text>
  212. <text class="textfontB4" style="color: #00A6FF;">{{orderxq.discountAmount}}{{i18n('locale.huobidw')}}</text>
  213. </view>
  214. <view v-if="orderxq.mdSalesReduction" style="margin-top: 10rpx;">
  215. <text class="textfontB4" style="color: green;">{{orderxq.mdSalesName}}</text>
  216. <text class="textfontB4" style="color: green;">{{orderxq.mdSalesReduction}}{{i18n('locale.huobidw')}}</text>
  217. </view>
  218. <view v-if="orderxq.mdDiscountAmount" style="margin-top: 10rpx;">
  219. <text class="textfontB4" style="color: green;">{{orderxq.mdYhName}}</text>
  220. <text class="textfontB4" style="color: green;">{{orderxq.mdDiscountAmount}}{{i18n('locale.huobidw')}}</text>
  221. </view>
  222. </view>
  223. <view class="contentInRowS spaceCtv">
  224. <text class="textfontB4">{{i18n('order.shangpinxj')}}</text>
  225. <text class="textfontB5">{{formPr(spxji)}}{{i18n('locale.huobidw')}}</text>
  226. </view>
  227. <view v-if="orderxq.type==0" class="contentInRowS spaceCtv">
  228. <text class="textfontB4">{{i18n('order.peisongfei')}}</text>
  229. <text class="textfontB5">{{formPr(peisongfei)}}{{i18n('locale.huobidw')}}</text>
  230. </view>
  231. <view v-if="yhjinr>0" class="contentInRowS spaceCtv">
  232. <text class="textfontB4">{{i18n('order.youhuijine')}}</text>
  233. <text class="textfontB5">-{{formPr(yhjinr)}}{{i18n('locale.huobidw')}}</text>
  234. </view>
  235. <view class="contentInRowS spaceCtvN">
  236. <text class="textfontB4">{{i18n('order.dingdanjin')}}</text>
  237. <text class="textfontB5">{{formPr(amount)}}{{i18n('locale.huobidw')}}</text>
  238. </view>
  239. <label class="linesp"></label>
  240. <view class="contentInRowS spaceCtv">
  241. <text class="textfontB4">{{i18n('order.danhao')}}</text>
  242. <text class="textfontB5">{{ddid}}</text>
  243. </view>
  244. <view class="contentInRowS spaceCtv">
  245. <text class="textfontB4">{{i18n('order.xiadanshijian')}}</text>
  246. <text class="textfontB5">{{cretim}}</text>
  247. </view>
  248. <view v-if="orderxq.remarks!=''" class="contentInRowL contentV">
  249. <view class="contentColumn">
  250. <text class="textfontB4">{{i18n('order.beizhu')}}:</text>
  251. <text class="pinglun textfontB5">{{orderxq.remarks}}</text>
  252. </view>
  253. </view>
  254. <view class="contentInRowS spaceCtv">
  255. <text class="textfontB4">{{i18n('order.menpaizp')}}</text>
  256. <text class="textfontB5"> </text>
  257. </view>
  258. <view class="contentColumnC" style="margin-top: 10rpx;" @click="selectImage">
  259. <netImage width="640" height="640" :mysrc="annexes" mymode="scaleToFill"></netImage>
  260. </view>
  261. <view style="height: 50rpx;"></view>
  262. </view>
  263. </scroll-view>
  264. <uni-popup style="z-index: 999;" ref="popzhif" type="center" :isMaskClick="true" :safeArea="true">
  265. <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
  266. <view style="height: 40rpx;"></view>
  267. <text>{{i18n('order.zhifufangshi')}}</text>
  268. <text class="zhifbut" style="background-color: deeppink;" @click="huodaofukuan">{{i18n('index.huodaofukan')}}</text>
  269. <text class="zhifbut" style="background-color:#00A6FF;" @click="getVNPay">VNPAY</text>
  270. <view style="height: 40rpx;"></view>
  271. </view>
  272. </uni-popup>
  273. </view>
  274. </template>
  275. <script>
  276. import api from "@/pages/api/api.js"
  277. export default {
  278. data() {
  279. return {
  280. cid:'',
  281. qsCid:'',
  282. ddid:'',
  283. orderxq:[],
  284. state:0,
  285. stateName:'',
  286. posName:'',
  287. telphone:'',
  288. food:[],
  289. amount:0,
  290. address:'',
  291. name:'',
  292. phone:'',
  293. annexes:'',
  294. Id:'',
  295. cretim:'',
  296. spxji:0,
  297. peisongfei:0,
  298. yhjinr:0,
  299. isshangjia:0,
  300. mendid:'',
  301. ordertype:0,
  302. mapHeight:0,
  303. scrollHeight:0,
  304. pcovers:'',
  305. ordertypename:'',
  306. timer:'',
  307. timerloc:'',
  308. startFl:0,
  309. showMap:0,
  310. statusBarHeight:0,
  311. isAndroid:false,
  312. upImage:false,
  313. jinduA:0,
  314. jinduB:0,
  315. }
  316. },
  317. onLoad(option) {
  318. this.cid=uni.getStorageSync('cid');
  319. this.ddid = option.ddid;
  320. this.isshangjia = option.isShangjia;
  321. var info = uni.getSystemInfoSync();
  322. this.isAndroid = info.platform.toLowerCase() === 'android';
  323. if(this.isAndroid){
  324. this.scrollHeight=info.windowHeight*(750/info.windowWidth)-280-info.statusBarHeight*(750/info.windowWidth);
  325. }
  326. else{
  327. this.scrollHeight=info.windowHeight*(750/info.windowWidth)-280-info.statusBarHeight*(750/info.windowWidth);
  328. }
  329. var that = this;
  330. uni.onPushMessage((res) => {
  331. console.log('onPushMessage',res);
  332. var content=res.data.content;
  333. // plus.runtime.setBadgeNumber(0);
  334. if(content.indexOf("骑手定位")!=-1){
  335. that.setpcovers(JSON.parse(res.data.payload));
  336. }
  337. });
  338. var that = this;
  339. this.timerloc = setInterval(() => {
  340. if(that.showMap==1){
  341. that.getstoreorderxq();
  342. }
  343. }, 10000);
  344. },
  345. onShow() {
  346. if(!this.upImage){
  347. this.getstoreorderxq();
  348. }
  349. },
  350. onUnload() {
  351. clearInterval(this.timer);
  352. clearInterval(this.timerloc);
  353. },
  354. methods: {
  355. lshxiugai(){
  356. return;
  357. console.log('lshxiugai');
  358. this.setorderuzt(5,this.Id);
  359. },
  360. isshouh(state){
  361. if(state==6||state==7||state==8||state==9){
  362. return true;
  363. }
  364. return false
  365. },
  366. isdaish(state){
  367. if(this.orderxq.type==0){
  368. if(state==12){
  369. return true;
  370. }
  371. }
  372. else{
  373. if(this.orderxq.diningStatus==1){
  374. return true;
  375. }
  376. }
  377. return false
  378. },
  379. formPr(price){
  380. var number = '0';
  381. var type = typeof(price);
  382. if(type=='string'){
  383. number = price
  384. }
  385. if(type=='number'){
  386. number = price.toString(); // 确保输入是字符串
  387. }
  388. const pattern = /(-?\d+)(\d{3})/;
  389. while (pattern.test(number)) {
  390. number = number.replace(pattern, "$1,$2");
  391. }
  392. return number;
  393. },
  394. arraytoStr(arry){
  395. var str='';
  396. if(arry.length>0){
  397. for(var i=0;i<arry.length;i++){
  398. str=str+arry[i]+'; ';
  399. }
  400. }
  401. return str;
  402. },
  403. i18n(str){
  404. var rstr = getApp().globalData.$t(str);
  405. return rstr;
  406. },
  407. getstoreorderxq(){
  408. console.log(this.ddid);
  409. api('getorderxq',{
  410. ddid:this.ddid
  411. },res=>{
  412. this.orderxq=res.data.data;
  413. this.qsCid=''
  414. console.log('1---------1:',res);
  415. this.dowithddxq();
  416. },failc=>{
  417. //console.log('getadvertis----',failc)
  418. })
  419. },
  420. dowithddxq(){
  421. this.state=this.orderxq.state;
  422. this.posName=this.orderxq.store.posName;
  423. this.telphone = this.orderxq.store.telephone;
  424. this.food=this.orderxq.food;
  425. this.amount=this.orderxq.amount;
  426. this.peisongfei=this.orderxq.freight;
  427. if(this.orderxq.shaddress){
  428. this.address=this.orderxq.shaddress.address;
  429. this.name=this.orderxq.shaddress.name;
  430. this.phone=this.orderxq.shaddress.phone;
  431. this.annexes=this.orderxq.shaddress.annexes;
  432. }
  433. this.Id=this.orderxq.id;
  434. this.cretim=this.orderxq.cretim;
  435. this.spxji = 0;
  436. this.mendid = this.orderxq.store.id;
  437. for (var i=0;i<this.food.length;i++) {
  438. var item = this.food[i];
  439. this.spxji=this.spxji+(item.price+item.otherPrice)*item.number;
  440. }
  441. this.getyhjinr();
  442. if(''==this.orderxq.delryTime||undefined==this.orderxq.delryTime||null==this.orderxq.delryTime){
  443. this.orderxq.delryTime=this.i18n('order.jinkuaichuc');
  444. }
  445. this.dowithOrderstate();
  446. this.dowithMap();
  447. },
  448. getyhjinr(){
  449. // "salesReduction":this.salesReduction, //平台促销減免值
  450. // "mdSalesReduction":this.mdSalesReduction,//门店促销減免值
  451. // "discountAmount":this.discountAmount, //平台优惠券优惠金额
  452. // "mdDiscountAmount":this.mdDiscountAmount, //门店优惠券优惠金额
  453. this.yhjinr=0;
  454. if(this.orderxq.discountAmount){
  455. this.yhjinr=this.orderxq.discountAmount;
  456. }
  457. if(this.orderxq.mdDiscountAmount){
  458. this.yhjinr=this.yhjinr + this.orderxq.mdDiscountAmount;
  459. }
  460. if(this.orderxq.salesReduction){
  461. this.yhjinr=this.yhjinr + this.orderxq.salesReduction;
  462. }
  463. if(this.orderxq.mdSalesReduction){
  464. this.yhjinr=this.yhjinr + this.orderxq.mdSalesReduction;
  465. }
  466. return;
  467. },
  468. dowithOrderstate(){
  469. switch(this.state){
  470. case 0:
  471. this.stateName = this.i18n('order.daifukshij');
  472. break;
  473. case 1:
  474. this.stateName = this.i18n('order.daishouli');
  475. break;
  476. case 2:
  477. this.stateName = this.i18n('order.yishouli');
  478. break;
  479. case 3:
  480. this.stateName = this.i18n('order.peisongzhong');
  481. break;
  482. case 4:
  483. this.stateName = this.i18n('order.peisongzhong');
  484. break;
  485. case 5:
  486. this.stateName = this.i18n('order.yiwancheng');
  487. break;
  488. case 6:
  489. this.stateName = this.i18n('order.shenqingtuikuan');
  490. break;
  491. case 7:
  492. this.stateName = this.i18n('order.tongyituik');
  493. break;
  494. case 8:
  495. this.stateName = this.i18n('order.jujuetuiK');
  496. break;
  497. case 9:{
  498. if(this.orderxq.kefuState==0){
  499. this.stateName = this.i18n('order.kefujs');
  500. break;
  501. }
  502. else{
  503. if(this.orderxq.kefuRepeat==0){
  504. //2未受理、1已受理、0已完成
  505. if(this.orderxq.kefuState==2){
  506. this.stateName = this.i18n('order.daishouli');
  507. break;
  508. }
  509. if(this.orderxq.kefuState==1){
  510. this.stateName = this.i18n('order.yishouli');
  511. break;
  512. }
  513. if(this.orderxq.kefuState==0){
  514. this.stateName = this.i18n('order.shouhwc');
  515. break;
  516. }
  517. }
  518. else{
  519. if(this.orderxq.repeatDdId){
  520. this.stateName = this.i18n('order.chongpaidd')+':'+this.orderxq.repeatDdId;
  521. break;
  522. }
  523. else{
  524. this.stateName = this.i18n('order.chongpaidd');
  525. break;
  526. }
  527. }
  528. }
  529. }
  530. case 10:
  531. this.stateName = this.i18n('order.zuofei');
  532. break;
  533. case 11:
  534. this.stateName = this.i18n('order.shouhwc');
  535. break;
  536. case 12:
  537. this.stateName=this.i18n('order.songda');
  538. break;
  539. }
  540. if(this.orderxq.type==0){
  541. this.ordertype = 0;
  542. this.ordertypename=this.i18n('order.peisong');
  543. }
  544. else if(this.orderxq.type==1){
  545. this.ordertype = 1;
  546. this.ordertypename=this.i18n('order.ziqu');
  547. if(this.state==3||this.state==4){
  548. this.stateName = this.i18n('order.daiqucan');
  549. }
  550. }
  551. else{
  552. this.ordertype = 2;
  553. this.ordertypename=this.i18n('shouye.tangshi');
  554. if(this.state==3||this.state==4){
  555. this.stateName = this.i18n('order.daiqucan');
  556. }
  557. }
  558. },
  559. dowithMap(){
  560. this.showMap=0;
  561. if(this.orderxq.type==0){
  562. if(this.orderxq.state==3||this.orderxq.state==4||this.orderxq.state==12){
  563. if(this.orderxq.RiderPosition.cid!=null){
  564. this.qsCid=this.orderxq.RiderPosition.cid;
  565. }
  566. if(this.orderxq.RiderPosition.latitude==0||this.orderxq.RiderPosition.longitude==0){
  567. return;
  568. }
  569. this.showMap=1;
  570. if(this.mapHeight==0){
  571. this.mapHeight=500;
  572. this.scrollHeight=this.scrollHeight-this.mapHeight;
  573. }
  574. var that = this;
  575. setTimeout(function() {
  576. // 这里写要延时执行的代码
  577. that.dongtaiJindu();
  578. that.setpcovers('');
  579. }, 500);
  580. }
  581. }
  582. },
  583. dongtaiJindu(){
  584. this.timer = setInterval(() => {
  585. if(this.orderxq.state==3){
  586. if(this.jinduA>=100){
  587. this.jinduA=0
  588. }
  589. this.jinduA=this.jinduA+3;
  590. this.jinduB=0;
  591. }
  592. if(this.orderxq.state==4){
  593. if(this.jinduB>=100){
  594. this.jinduB=0
  595. }
  596. this.jinduB=this.jinduB+3;
  597. this.jinduA=100;
  598. }
  599. }, 100);
  600. },
  601. setpcovers(obj){
  602. // this.pcovers=[{//门店
  603. // latitude: this.orderxq.store.latitude,
  604. // longitude: this.orderxq.store.longitude,
  605. // iconPath: '/static/images/Bdizhil@3x.png'
  606. // }];
  607. if(obj==''){
  608. this.pcovers=[{//骑手
  609. latitude: this.orderxq.RiderPosition.latitude,
  610. longitude: this.orderxq.RiderPosition.longitude,
  611. iconPath: '/static/images/qishoutb@3x.png'
  612. }];
  613. }
  614. else{
  615. this.pcovers=[{//骑手
  616. latitude:obj.latitude,
  617. longitude:obj.longitude,
  618. iconPath: '/static/images/qishoutb@3x.png'
  619. }];
  620. }
  621. if(this.orderxq.shaddress){
  622. var mudi={
  623. latitude:this.orderxq.shaddress.latitude,
  624. longitude:this.orderxq.shaddress.longitude,
  625. iconPath: '/static/images/Bdizhil@3x.png'
  626. }
  627. this.pcovers.push(mudi);
  628. }
  629. },
  630. callPhone(){
  631. var that = this;
  632. uni.showModal({
  633. cancelText:that.i18n('order.quxiao'),
  634. confirmText:that.i18n('comp.queren'),
  635. title: that.i18n('api.message'),
  636. content:that.i18n('api.nqdbddh'),
  637. success: function (res) {
  638. if (res.confirm) { //这里是点击了确定以后
  639. console.log(that.mendianMs.telphone)
  640. plus.device.dial(that.mendianMs.telphone, false );
  641. } else { //这里是点击了取消以后
  642. console.log('点击取消')
  643. }
  644. }
  645. })
  646. },
  647. phoneCall(){
  648. var that = this;
  649. uni.showModal({
  650. cancelText:that.i18n('order.quxiao'),
  651. confirmText:that.i18n('comp.queren'),
  652. title: that.i18n('api.message'),
  653. content:that.i18n('api.nqdbddh'),
  654. success: function (res) {
  655. if (res.confirm) { //这里是点击了确定以后
  656. console.log(that.orderxq.qsuser.phone)
  657. plus.device.dial(that.orderxq.qsuser.phone, false );
  658. } else { //这里是点击了取消以后
  659. console.log('点击取消')
  660. }
  661. }
  662. })
  663. },
  664. audioCall(){
  665. var data = {
  666. ddId:this.orderxq.ddId,
  667. userId:this.orderxq.qsId,
  668. nickName:'',
  669. avatar:'',
  670. cid:this.qsCid
  671. }
  672. uni.setStorageSync('imUser',data)
  673. uni.navigateTo({
  674. url:'/pages/imcall/audioCall?caller=1'
  675. })
  676. },
  677. exchange(){
  678. var data = {
  679. ddId:this.orderxq.ddId,
  680. userId:this.orderxq.qsId,
  681. nickName:'',
  682. avatar:'',
  683. cid:this.qsCid
  684. }
  685. uni.setStorageSync('imUser',data)
  686. uni.navigateTo({
  687. url:'/pages/imcall/GoeasyExchange?caller=1'
  688. })
  689. },
  690. reloadLocate(){
  691. console.log(this.qsCid)
  692. if(this.qsCid!=''){
  693. this.pushMsg(this.qsCid)
  694. }
  695. },
  696. choosebt(index){
  697. switch(index){
  698. case 1://去支付
  699. {
  700. this.$refs.popzhif.open('bottom');
  701. //this.zffsS=true;
  702. }
  703. break;
  704. case 2://修改订单
  705. break;
  706. case 3://取消订单
  707. var that = this;
  708. uni.showModal({
  709. cancelText:that.i18n('order.quxiao'),
  710. confirmText:that.i18n('comp.queren'),
  711. title: that.i18n('api.message'),
  712. content: that.i18n('order.shifouqx')+that.ddid+'?',
  713. success: function (res) {
  714. if (res.confirm) { //这里是点击了确定以后
  715. that.setorderuzt(10,that.Id);
  716. } else { //这里是点击了取消以后
  717. console.log('用户点击取消')
  718. }
  719. }
  720. })
  721. break;
  722. case 4://发表评论
  723. //this.setorderuzt(3,this.Id);
  724. uni.navigateTo({
  725. url:'/pages/OrderList/pinglun?mendid='+this.mendid+'&ddId='+this.ddid
  726. })
  727. break;
  728. return
  729. case 5://售后列表
  730. uni.navigateTo({
  731. url:'/pages/kehufuwu/kefuMsgList?ddId='+this.orderxq.ddId
  732. })
  733. break;
  734. case 6://完成订单
  735. var that = this;
  736. uni.showModal({
  737. cancelText:that.i18n('order.quxiao'),
  738. confirmText:that.i18n('comp.queren'),
  739. title: that.i18n('api.message'),
  740. content: that.i18n('mend.shifwanch')+that.ddid+that.i18n('index.order')+'?',
  741. success: function (res) {
  742. if (res.confirm) { //这里是点击了确定以后
  743. that.setorderuzt(5,that.Id);
  744. } else { //这里是点击了取消以后
  745. console.log('用户点击取消')
  746. }
  747. }
  748. })
  749. break;
  750. case 7://开始售后
  751. var that = this;
  752. uni.showModal({
  753. cancelText:that.i18n('order.quxiao'),
  754. confirmText:that.i18n('comp.queren'),
  755. title: that.i18n('api.message'),
  756. content: that.i18n('order.shifoushenq')+that.ddid+that.i18n('order.kefujs')+'?',
  757. success: function (res) {
  758. if (res.confirm) { //这里是点击了确定以后
  759. if(that.orderxq.collectPayment==1){
  760. that.setorderuzt(9,that.Id);
  761. }
  762. else{
  763. that.setorderuzt(6,that.Id);
  764. }
  765. } else { //这里是点击了取消以后
  766. console.log('用户点击取消')
  767. }
  768. }
  769. })
  770. break;
  771. }
  772. },
  773. setorderuzt(state,id){
  774. api('setorderuzt',{
  775. id:id,
  776. state:state
  777. },res=>{
  778. console.log('setorderuzt',res)
  779. this.getstoreorderxq();
  780. },failc=>{
  781. //console.log('getadvertis----',failc)
  782. })
  783. },
  784. //直接全额退款
  785. quanertuikuan(state){
  786. console.log('quanertuikuan');
  787. api('VNtuikuan',{
  788. "order_id": this.ddid, //需要退款的订单号
  789. "amount": parseInt(this.amount), //退款金额
  790. "trantype": '02', //退款类型:02全额退款,03部份退款
  791. 'illustrate':'全额退款',
  792. "transaction":'' //交易号,不存在可为空
  793. },res=>{
  794. console.log('VNtuikuan',res);
  795. if(res.data.code==200){
  796. if(res.data.data.vnp_ResponseCode=='00'){
  797. uni.showToast({
  798. title:this.i18n('order.tuikuanchg'),
  799. icon: 'none',
  800. duration: 2500
  801. })
  802. this.setorderuzt(state,this.Id);
  803. }else if(res.data.data.vnp_ResponseCode=='94'){
  804. uni.showToast({
  805. title:this.i18n('order.tuikuanchg'),
  806. icon: 'none',
  807. duration: 2500
  808. })
  809. this.setorderuzt(state,this.Id);
  810. }
  811. else{
  812. uni.showToast({
  813. title: res.data.data.vnp_Message,
  814. icon: 'none',
  815. duration: 2500
  816. })
  817. }
  818. }
  819. else{
  820. uni.showToast({
  821. title: res.data.msg,
  822. icon: 'none',
  823. duration: 2500
  824. })
  825. }
  826. },failc=>{
  827. console.log('VNtuikuan',failc)
  828. })
  829. },
  830. huodaofukuan(){
  831. this.$refs.popzhif.close();
  832. uni.showLoading({
  833. title:'Loading...',
  834. mask:true
  835. })
  836. api('setorderuzt',{
  837. id:this.Id,
  838. "collectPayment":1
  839. },res=>{
  840. console.log('setorderuzt:',res)
  841. uni.hideLoading();
  842. if(res.data.code==200){
  843. this.getstoreorderxq();
  844. }
  845. else{
  846. uni.showToast({
  847. title: res.data.msg,
  848. icon: 'none',
  849. duration: 2000
  850. })
  851. }
  852. },failc=>{
  853. uni.hideLoading();
  854. //console.log('getadvertis----',failc)
  855. })
  856. },
  857. getVNPay(){
  858. this.$refs.popzhif.close();
  859. api('setorderuzt',{
  860. id:this.Id,
  861. "collectPayment":0
  862. },res=>{
  863. if(res.data.code!=200){
  864. return;
  865. }
  866. },failc=>{
  867. return;
  868. })
  869. //this.getVNPay();//支付链接不能重复利用
  870. if(null==this.orderxq.payUrl ||undefined==this.orderxq.payUrl || this.orderxq.payUrl==''||this.orderxq.payUrl.length<10){
  871. }
  872. else{
  873. uni.navigateTo({
  874. url:'/pages/OrderList/buy/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(this.orderxq.payUrl))+'&ddid='+this.ddid
  875. })
  876. return;
  877. }
  878. var language = uni.getStorageSync('language');
  879. var lg;
  880. if(language=='yuenan'){
  881. lg='vi';
  882. }
  883. else{
  884. lg='en';
  885. }
  886. api('VNPay',{
  887. orderid:this.ddid,
  888. amount:parseInt(this.amount),
  889. language:lg
  890. },res=>{
  891. if(res.data.code!=200){
  892. uni.showToast({
  893. title: res.data.msg,
  894. icon: 'none',
  895. duration: 3500
  896. })
  897. return;
  898. }
  899. uni.navigateTo({
  900. url:'/pages/OrderList/buy/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(res.data.data))+'&ddid='+this.ddid
  901. })
  902. },failc=>{
  903. //console.log('getadvertis----',failc)
  904. })
  905. },
  906. //请求位置
  907. pushMsg(cid){//消息推送
  908. var payloadData={
  909. cid:this.cid,
  910. latitude:'',
  911. longitude:''
  912. }
  913. api('pushMsgQS',{
  914. cid:cid,
  915. title:'Request',
  916. content:'Request location',
  917. payload:payloadData
  918. },res=>{
  919. console.log(res)
  920. },failc=>{
  921. //console.log('getadvertis----',failc)
  922. })
  923. },
  924. selectImage(){
  925. console.log('selectImage');
  926. this.upImage=true;
  927. var that = this;
  928. uni.chooseImage({
  929. count: 1, // 图片数量
  930. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  931. sourceType: ['album'], //从相册选择或者拍照
  932. success: (res) => {
  933. const tempFilePaths = res.tempFilePaths;
  934. console.log('-----',tempFilePaths)
  935. uni.uploadFile({
  936. url:'https://api.cityexpress168.com.vn/utils/Upload', //上传图片api
  937. // url:'https://cteapi.waimai-paotui.com/utils/Upload', //上传图片api
  938. filePath: tempFilePaths[0],
  939. name: 'file',
  940. header:{
  941. //"Authorization": userinfo.token
  942. },
  943. success: (res) => {
  944. this.upImage=false;
  945. let group = JSON.parse(res.data);
  946. that.annexes=group.data;
  947. console.log('aaaa',group)
  948. api('ADDaddress',{
  949. id:that.orderxq.shaddress.id,
  950. annexes:group.data
  951. },
  952. res=>{
  953. if(res.data.code==200){
  954. }
  955. console.log('getGoodsDetail:',res);
  956. },failc=>{
  957. //console.log('getadvertis----',failc)
  958. })
  959. uni.showToast({
  960. title:'success',
  961. icon:"success"
  962. })
  963. },
  964. fail: (res) =>{
  965. console.log('uni.uploadFile',res)
  966. this.upImage=false;
  967. }
  968. });
  969. }
  970. });
  971. },
  972. }
  973. }
  974. </script>
  975. <style lang="scss">
  976. .spaceCtv{
  977. width:690upx;
  978. margin-left: 30upx;
  979. align-items: center;
  980. height: 80rpx;
  981. border-bottom-width: 2rpx;
  982. border-bottom-color:lightgray;
  983. }
  984. .spaceCtvh{
  985. width:690upx;
  986. margin-left: 30upx;
  987. align-items: center;
  988. height: 150rpx;
  989. border-bottom-width: 2rpx;
  990. border-bottom-color:lightgray;
  991. }
  992. .spaceCtvauto{
  993. width:690upx;
  994. margin-left: 30upx;
  995. justify-content: flex-start;
  996. border-bottom-width: 2rpx;
  997. border-bottom-color:lightgray;
  998. }
  999. .spaceCtvN{
  1000. width:690upx;
  1001. margin-left: 30upx;
  1002. align-items: center;
  1003. height: 80rpx;
  1004. }
  1005. .mapcontent{
  1006. position: fixed;
  1007. height: 400rpx;
  1008. left: 0;
  1009. right: 0;
  1010. z-index: 999;
  1011. }
  1012. .mapview{
  1013. display: flex;
  1014. width: 750upx;
  1015. }
  1016. .contentV{
  1017. width:690upx;
  1018. margin-left: 30upx;
  1019. margin-top: 20rpx;
  1020. }
  1021. .viewinrow{
  1022. display: flex;
  1023. flex-direction: row;
  1024. align-items: center;
  1025. }
  1026. .topActV{
  1027. width: 750upx;
  1028. height: 180rpx;
  1029. background-color: white;
  1030. }
  1031. .topActVB{
  1032. width: 750upx;
  1033. height: 180rpx;
  1034. background-color: white;
  1035. }
  1036. .notext{
  1037. padding-top: 10rpx;
  1038. padding-left: 20rpx;
  1039. font-size: 40rpx;
  1040. color: #000;
  1041. font-weight:bold;
  1042. }
  1043. .nodetail{
  1044. height: 88rpx;
  1045. margin-left: 10rpx;
  1046. margin-right: 10rpx;
  1047. margin-top: 10rpx;
  1048. padding-left: 2rpx;
  1049. flex-direction: row;
  1050. align-items: center;
  1051. justify-content: flex-start;
  1052. background-color: #F1F1F1;
  1053. font-size: 30rpx;
  1054. }
  1055. .xingimage{
  1056. width: 36rpx;
  1057. height: 36rpx;
  1058. }
  1059. .actBTVS{
  1060. display: flex;
  1061. flex-direction: row;
  1062. justify-content:space-between;
  1063. align-items: center;
  1064. width: 650upx;
  1065. margin-left: 15rpx;
  1066. }
  1067. .actBTV{
  1068. width: 720upx;
  1069. margin-left: 15upx;
  1070. display: flex;
  1071. flex-direction: row;
  1072. justify-content:space-between;
  1073. align-items: center;
  1074. }
  1075. .actbt{
  1076. width: 160upx;
  1077. margin-top: 10rpx;
  1078. margin-bottom: 10rpx;
  1079. align-items: center;
  1080. justify-content: center;
  1081. }
  1082. .ddbticon{
  1083. margin-top: 6rpx;
  1084. width: 160upx;
  1085. height: 80rpx;
  1086. display: flex;
  1087. align-items: center;
  1088. justify-content: center;
  1089. }
  1090. .ddtext{
  1091. margin-top: 6rpx;
  1092. text-align: center;
  1093. color: black;
  1094. }
  1095. .bticon{
  1096. width: 50rpx;
  1097. height: 50rpx;
  1098. }
  1099. .spnodetail{
  1100. display: flex;
  1101. flex-direction: row;
  1102. align-items: center;
  1103. background-color: white;
  1104. margin-top: 20rpx;
  1105. margin-bottom: 20rpx;
  1106. }
  1107. .spIcon{
  1108. margin: 20rpx;
  1109. width: 90rpx;
  1110. height: 90rpx;
  1111. }
  1112. .xiaoji{
  1113. margin-right: 30rpx;
  1114. }
  1115. .kouweisku{
  1116. padding-right: 10rpx;
  1117. color: chocolate;
  1118. font-size: 26rpx;
  1119. width: 600upx;
  1120. }
  1121. .linesp{
  1122. width: 750upx;
  1123. height: 8rpx;
  1124. background-color: aliceblue;
  1125. }
  1126. .buyGoodsv{
  1127. width: 750upx;
  1128. text-align: left;
  1129. height: 60rpx;
  1130. line-height: 60rpx;
  1131. padding-left: 10rpx;
  1132. flex-direction: row;
  1133. align-items: center;
  1134. justify-content: center;
  1135. }
  1136. .stattypeD{
  1137. color: black;
  1138. font-weight: bold;
  1139. font-size: 26rpx;
  1140. margin-left: 10rpx;
  1141. }
  1142. .stattypeA{
  1143. color: darkgray;
  1144. font-size: 26rpx;
  1145. margin-left: 10rpx;
  1146. }
  1147. .stattype{
  1148. font-size: 26rpx;
  1149. margin-right: 40rpx;
  1150. }
  1151. .pinglun{
  1152. margin: 16rpx;
  1153. padding: 10rpx;
  1154. width:660upx;
  1155. border-radius: 15rpx;
  1156. border: 2rpx solid lightgray;
  1157. }
  1158. .zhifbut{
  1159. text-align:center;
  1160. margin-top: 12rpx;
  1161. margin-bottom: 12rpx;
  1162. width:660upx;
  1163. border-radius: 10rpx;
  1164. color: white;
  1165. line-height: 70rpx;
  1166. }
  1167. .adrrTextV{
  1168. padding-top: 6rpx;
  1169. padding-bottom: 6rpx;
  1170. width:680upx;
  1171. }
  1172. .foodNameV{
  1173. font-size: 30rpx;
  1174. width:500upx;
  1175. }
  1176. </style>