OrderDetail.nvue 27 KB

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