| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222 |
- <template>
- <view class="">
- <customNav :shownav="true" :title="i18n('index.orderxq')" titledetl=""></customNav>
- <weizhimap v-if="showMap==1" class="mapview" :style="'height:'+mapHeight+'rpx;'" :height="mapHeight" :covers="pcovers"></weizhimap>
- <view v-if="state==0" class="topActV">
- <view class="contentInRowC">
- <view class="actBTVS">
- <view v-if="orderxq.collectPayment==0" class="actbt" @click="choosebt(1)">
- <view class="ddbticon">
- <image class="bticon" src="/static/images/qzhifu@3x.png" mode="scaleToFill"></image>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('order.quzhifu')}}</text>
- </view>
- </view>
- <view v-if="orderxq.collectPayment==1" class="actbt">
- <view class="ddbticon">
- <image class="bticon" src="/static/images/qzhifu@3x.png" mode="scaleToFill"></image>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('index.huodaofukan')}}</text>
- </view>
- </view>
- <view class="actbt" @click="choosebt(3)">
- <view class="ddbticon">
- <image class="bticon" src="/static/images/quxiao@3x.png" mode="scaleToFill"></image>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('order.quxiaodingdan')}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <label class="linesp"></label>
- <view v-if="state>0" class="topActVB">
- <view class="actBTV">
- <view v-if="state==5" class="actbt" @click="choosebt(4)">
- <view class="ddbticon">
- <image class="bticon" src="/static/images/xiugai@3x.png" mode="scaleToFill" ></image>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('order.fabiaopinglun')}}</text>
- </view>
- </view>
- <view v-if="isshouh(state)" class="actbt" >
- <view class="ddbticon" @click="choosebt(5)">
- <uni-icons custom-prefix="custom-icon" color="#386EF5" type="chat-filled" size="30"></uni-icons>
- </view>
- <view class="ddtext" @click="choosebt(5)">
- <text style="font-size: 32rpx;">{{i18n('order.lianxikef')}}</text>
- </view>
- </view>
- <view v-if="state==7&&orderxq.collectPayment!=1" class="actbt" >
- <view class="ddbticon" @click="quanertuikuan(11)">
- <image class="bticon" src="/static/images/payflact@3x.png" mode="scaleToFill"></image>
- </view>
- <view class="ddtext" @click="quanertuikuan(11)">
- <text style="font-size: 32rpx;">{{i18n('order.tongyituik')}}</text>
- </view>
- </view>
- <view v-if="isdaish(state)" class="actbt" @click="choosebt(7)">
- <view class="ddbticon">
- <uni-icons custom-prefix="custom-icon" color="#E02F73" type="closeempty" size="30"></uni-icons>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('order.candianyw')}}</text>
- </view>
- </view>
- <view v-if="isdaish(state)" class="actbt" @click="choosebt(6)">
- <view class="ddbticon" >
- <uni-icons custom-prefix="custom-icon" color="#386EF5" type="checkmarkempty" size="30"></uni-icons>
- </view>
- <view class="ddtext">
- <text style="font-size: 32rpx;">{{i18n('order.wancheng')}}</text>
- </view>
- </view>
- <view class="actbt" >
- <view class="ddbticon" @click="callPhone">
- <image class="bticon" src="/static/images/kefu@3x.png" mode="scaleToFill" ></image>
- </view>
- <view class="ddtext" @click="callPhone">
- <text style="font-size: 30rpx;">{{i18n('order.lianxishj')}}</text>
- </view>
- </view>
- <view v-if="showMap==1" class="actbt">
- <view class="ddbticon" @click="reloadLocate">
- <image style="width: 80rpx;height: 80rpx;" src="/static/images/qishoutb@3x.png" mode="scaleToFill"></image>
- </view>
- <view class="ddtext" @click="reloadLocate">
- <text style="font-size: 32rpx;">{{i18n('order.shuaxin')}}</text>
- </view>
- </view>
- </view>
- </view>
- <label class="linesp"></label>
- <scroll-view :style="'height:'+scrollHeight+'rpx;'" scroll-y="true">
- <view class="contentColumn" style="background-color: white;">
- <view class="contentInRowS spaceCtv">
- <view class="contentInRowL">
- <image style="width: 40rpx;height: 40rpx;" src="/static/images/shouye.png" mode="scaleToFill"></image>
- <text class="textfontB3">{{posName}}</text>
- </view>
- <text class="textfontB4">{{ordertypename}}</text>
- </view>
- <view class="contentInRowS spaceCtv" @click="lshxiugai()">
- <view class="contentInRowL">
- <text class="textfontB3">{{i18n('order.zhuangtai')}}</text>
- </view>
- <text class="textfontB4">{{stateName}}</text>
- </view>
- <view v-if="showMap==1" class="contentColumn">
- <view class="contentInRowS spaceCtvh">
- <view class="contentColumnC">
- <netImage bradius="8" width="90" height="90" :mysrc="orderxq.qsuser.avatar" mymode="scaleToFill"></netImage>
- <text style="font-size: 28rpx;">{{orderxq.qsuser.nickName}}</text>
- </view>
- <view class="contentColumnC" @click="phoneCall">
- <uni-icons custom-prefix="custom-icon" color="#386EF5" type="phone" size="28"></uni-icons>
- <text style="font-size: 28rpx;">phone</text>
- </view>
- <view class="contentColumnC" @click="audioCall">
- <uni-icons custom-prefix="custom-icon" color="#386EF5" type="phone-filled" size="28"></uni-icons>
- <text style="font-size: 28rpx;">IM Call</text>
- </view>
- <view class="contentColumnC" @click="exchange">
- <uni-icons custom-prefix="custom-icon" color="#386EF5" type="chatboxes" size="28"></uni-icons>
- <text style="font-size: 28rpx;">{{i18n('exchange.xinxi')}}</text>
- </view>
- </view>
- <view class="contentColumn">
- <view class="contentInRowL contentV" >
- <text style="font-size: 28rpx;">{{i18n('order.chepaihao')}}: </text>
- <text style="font-size: 28rpx;">{{orderxq.qsuser.licensePlate}}</text>
- </view>
- <view class="contentInRowL contentV" style="height: 50rpx;align-items: center;">
- <text style="font-size: 28rpx;">{{i18n('order.yishouli')}}</text>
- <progress :percent="jinduA" activeColor="#006AFF" stroke-width="4" />
- <text style="font-size: 28rpx;">{{i18n('order.peisong')}}</text>
- <progress :percent="jinduB" activeColor="#006AFF" stroke-width="5" />
- <text style="font-size: 28rpx;">{{i18n('order.yiwancheng')}}</text>
- </view>
- </view>
- <label class="linesp"></label>
- </view>
- <view v-for="item in food">
- <view class="spnodetail">
- <view class="">
- <netImage class="spIcon" width="90" height="90" :mysrc="item.image" mymode="scaleToFill"></netImage>
- </view>
- <view style="width: 600upx">
- <view class="contentInRowS">
- <text class="foodNameV">{{item.name}}</text>
- <text style="font-size: 28rpx;color: brown;margin-right: 30rpx;">X {{item.number}}</text>
- </view>
- <view class="contentInRowS">
- <text style="font-size: 26rpx;color: blueviolet;">{{i18n('shangpin.shoujia')}}: {{formPr(item.price+item.otherPrice)}}{{i18n('locale.huobidw')}}</text>
- <text class="xiaoji" style="font-size: 28rpx;color: brown;">{{i18n('shangpin.xiaoji')}}: {{formPr((item.price+item.otherPrice)*item.number)}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view class="viewinrow" >
- <text class="kouweisku">{{arraytoStr(item.ask)}}</text>
- </view>
- <view v-if="item.beizhu" class="">
- <text style="font-size: 30rpx;color:#00A6FF;">{{item.beizhu}}</text>
- </view>
- </view>
- </view>
- <label class="linesp"></label>
- </view>
- <view v-if="orderxq.type==0" class="contentColumn spaceCtvauto" >
- <text class="textfontB4">{{i18n('index.peisongdizhi')}}</text>
- <text class="textfontS1 adrrTextV">{{address}}</text>
- </view>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.shoujianren')}}</text>
- <text class="textfontB5">{{name}}</text>
- </view>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.lianxidianhua')}}</text>
- <text class="textfontB5">{{phone}}</text>
- </view>
- <view class="contentInRowS spaceCtvN">
- <text class="textfontB4">{{i18n('order.yuyueshijian')}}</text>
- <text class="textfontB5">{{orderxq.delryTime}}</text>
- </view>
- <label class="linesp"></label>
- <view v-if="ordertype!=0">
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.mendiandiz')}}</text>
- <text class="textfontB5">{{address}}</text>
- </view>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.lianxidianhua')}}</text>
- <text class="textfontB5">{{phone}}</text>
- </view>
- <view class="contentInRowS spaceCtvN">
- <text class="textfontB4">{{i18n('order.yuyueshijian')}}</text>
- <text class="textfontB5">{{orderxq.delryTime}}</text>
- </view>
- </view>
- <label class="linesp"></label>
- <view v-if="yhjinr>0" class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('index.youhuiq')}}</text>
- </view>
- <view v-if="yhjinr>0" class="contentColumn spaceCtvauto">
- <view v-if="orderxq.salesReduction" style="margin-top: 10rpx;">
- <text class="textfontB4" style="color: #00A6FF;">{{orderxq.salesName}}</text>
- <text class="textfontB4" style="color: #00A6FF;">{{orderxq.salesReduction}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view v-if="orderxq.discountAmount" style="margin-top: 10rpx;">
- <text class="textfontB4" style="color: #00A6FF;">{{orderxq.yhName}}</text>
- <text class="textfontB4" style="color: #00A6FF;">{{orderxq.discountAmount}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view v-if="orderxq.mdSalesReduction" style="margin-top: 10rpx;">
- <text class="textfontB4" style="color: green;">{{orderxq.mdSalesName}}</text>
- <text class="textfontB4" style="color: green;">{{orderxq.mdSalesReduction}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view v-if="orderxq.mdDiscountAmount" style="margin-top: 10rpx;">
- <text class="textfontB4" style="color: green;">{{orderxq.mdYhName}}</text>
- <text class="textfontB4" style="color: green;">{{orderxq.mdDiscountAmount}}{{i18n('locale.huobidw')}}</text>
- </view>
- </view>
-
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.shangpinxj')}}</text>
- <text class="textfontB5">{{formPr(spxji)}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view v-if="orderxq.type==0" class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.peisongfei')}}</text>
- <text class="textfontB5">{{formPr(peisongfei)}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view v-if="yhjinr>0" class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.youhuijine')}}</text>
- <text class="textfontB5">-{{formPr(yhjinr)}}{{i18n('locale.huobidw')}}</text>
- </view>
- <view class="contentInRowS spaceCtvN">
- <text class="textfontB4">{{i18n('order.dingdanjin')}}</text>
- <text class="textfontB5">{{formPr(amount)}}{{i18n('locale.huobidw')}}</text>
- </view>
- <label class="linesp"></label>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.danhao')}}</text>
- <text class="textfontB5">{{ddid}}</text>
- </view>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.xiadanshijian')}}</text>
- <text class="textfontB5">{{cretim}}</text>
- </view>
- <view v-if="orderxq.remarks!=''" class="contentInRowL contentV">
- <view class="contentColumn">
- <text class="textfontB4">{{i18n('order.beizhu')}}:</text>
- <text class="pinglun textfontB5">{{orderxq.remarks}}</text>
- </view>
- </view>
- <view class="contentInRowS spaceCtv">
- <text class="textfontB4">{{i18n('order.menpaizp')}}</text>
- <text class="textfontB5"> </text>
- </view>
- <view class="contentColumnC" style="margin-top: 10rpx;" @click="selectImage">
- <netImage width="640" height="640" :mysrc="annexes" mymode="scaleToFill"></netImage>
- </view>
- <view style="height: 50rpx;"></view>
- </view>
- </scroll-view>
- <uni-popup style="z-index: 999;" ref="popzhif" type="center" :isMaskClick="true" :safeArea="true">
- <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
- <view style="height: 40rpx;"></view>
- <text>{{i18n('order.zhifufangshi')}}</text>
- <text class="zhifbut" style="background-color: deeppink;" @click="huodaofukuan">{{i18n('index.huodaofukan')}}</text>
- <text class="zhifbut" style="background-color:#00A6FF;" @click="getVNPay">VNPAY</text>
- <view style="height: 40rpx;"></view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import api from "@/pages/api/api.js"
- export default {
- data() {
- return {
- cid:'',
- qsCid:'',
- ddid:'',
- orderxq:[],
- state:0,
- stateName:'',
- posName:'',
- telphone:'',
- food:[],
- amount:0,
- address:'',
- name:'',
- phone:'',
- annexes:'',
- Id:'',
- cretim:'',
- spxji:0,
- peisongfei:0,
- yhjinr:0,
- isshangjia:0,
- mendid:'',
- ordertype:0,
- mapHeight:0,
- scrollHeight:0,
- pcovers:'',
- ordertypename:'',
- timer:'',
- timerloc:'',
- startFl:0,
- showMap:0,
- statusBarHeight:0,
- isAndroid:false,
- upImage:false,
- jinduA:0,
- jinduB:0,
- }
- },
- onLoad(option) {
- this.cid=uni.getStorageSync('cid');
- this.ddid = option.ddid;
- this.isshangjia = option.isShangjia;
- var info = uni.getSystemInfoSync();
-
- this.isAndroid = info.platform.toLowerCase() === 'android';
-
- if(this.isAndroid){
- this.scrollHeight=info.windowHeight*(750/info.windowWidth)-280-info.statusBarHeight*(750/info.windowWidth);
- }
- else{
- this.scrollHeight=info.windowHeight*(750/info.windowWidth)-280-info.statusBarHeight*(750/info.windowWidth);
- }
- var that = this;
- uni.onPushMessage((res) => {
- console.log('onPushMessage',res);
- var content=res.data.content;
- // plus.runtime.setBadgeNumber(0);
- if(content.indexOf("骑手定位")!=-1){
- that.setpcovers(JSON.parse(res.data.payload));
- }
- });
- var that = this;
- this.timerloc = setInterval(() => {
- if(that.showMap==1){
- that.getstoreorderxq();
- }
- }, 10000);
-
- },
- onShow() {
- if(!this.upImage){
- this.getstoreorderxq();
- }
- },
- onUnload() {
- clearInterval(this.timer);
- clearInterval(this.timerloc);
- },
- methods: {
- lshxiugai(){
- return;
- console.log('lshxiugai');
- this.setorderuzt(5,this.Id);
- },
- isshouh(state){
- if(state==6||state==7||state==8||state==9){
- return true;
- }
- return false
- },
- isdaish(state){
- if(this.orderxq.type==0){
- if(state==12){
- return true;
- }
- }
- else{
- if(this.orderxq.diningStatus==1){
- return true;
- }
- }
-
- return false
- },
- formPr(price){
- var number = '0';
- var type = typeof(price);
- if(type=='string'){
- number = price
- }
- if(type=='number'){
- number = price.toString(); // 确保输入是字符串
- }
-
- const pattern = /(-?\d+)(\d{3})/;
- while (pattern.test(number)) {
- number = number.replace(pattern, "$1,$2");
- }
- return number;
- },
- arraytoStr(arry){
- var str='';
- if(arry.length>0){
- for(var i=0;i<arry.length;i++){
- str=str+arry[i]+'; ';
- }
-
- }
- return str;
- },
- i18n(str){
- var rstr = getApp().globalData.$t(str);
- return rstr;
- },
- getstoreorderxq(){
- console.log(this.ddid);
- api('getorderxq',{
- ddid:this.ddid
- },res=>{
- this.orderxq=res.data.data;
- this.qsCid=''
- console.log('1---------1:',res);
- this.dowithddxq();
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
- dowithddxq(){
- this.state=this.orderxq.state;
- this.posName=this.orderxq.store.posName;
- this.telphone = this.orderxq.store.telephone;
- this.food=this.orderxq.food;
- this.amount=this.orderxq.amount;
- this.peisongfei=this.orderxq.freight;
- if(this.orderxq.shaddress){
- this.address=this.orderxq.shaddress.address;
- this.name=this.orderxq.shaddress.name;
- this.phone=this.orderxq.shaddress.phone;
- this.annexes=this.orderxq.shaddress.annexes;
- }
- this.Id=this.orderxq.id;
- this.cretim=this.orderxq.cretim;
- this.spxji = 0;
- this.mendid = this.orderxq.store.id;
- for (var i=0;i<this.food.length;i++) {
- var item = this.food[i];
- this.spxji=this.spxji+(item.price+item.otherPrice)*item.number;
- }
- this.getyhjinr();
- if(''==this.orderxq.delryTime||undefined==this.orderxq.delryTime||null==this.orderxq.delryTime){
- this.orderxq.delryTime=this.i18n('order.jinkuaichuc');
- }
- this.dowithOrderstate();
- this.dowithMap();
- },
- getyhjinr(){
- // "salesReduction":this.salesReduction, //平台促销減免值
- // "mdSalesReduction":this.mdSalesReduction,//门店促销減免值
- // "discountAmount":this.discountAmount, //平台优惠券优惠金额
- // "mdDiscountAmount":this.mdDiscountAmount, //门店优惠券优惠金额
- this.yhjinr=0;
- if(this.orderxq.discountAmount){
- this.yhjinr=this.orderxq.discountAmount;
- }
-
- if(this.orderxq.mdDiscountAmount){
- this.yhjinr=this.yhjinr + this.orderxq.mdDiscountAmount;
- }
-
- if(this.orderxq.salesReduction){
- this.yhjinr=this.yhjinr + this.orderxq.salesReduction;
- }
-
- if(this.orderxq.mdSalesReduction){
- this.yhjinr=this.yhjinr + this.orderxq.mdSalesReduction;
- }
-
- return;
- },
- dowithOrderstate(){
- switch(this.state){
- case 0:
- this.stateName = this.i18n('order.daifukshij');
- break;
- case 1:
- this.stateName = this.i18n('order.daishouli');
- break;
- case 2:
- this.stateName = this.i18n('order.yishouli');
- break;
- case 3:
- this.stateName = this.i18n('order.peisongzhong');
- break;
- case 4:
- this.stateName = this.i18n('order.peisongzhong');
- break;
- case 5:
- this.stateName = this.i18n('order.yiwancheng');
- break;
- case 6:
- this.stateName = this.i18n('order.shenqingtuikuan');
- break;
- case 7:
- this.stateName = this.i18n('order.tongyituik');
- break;
- case 8:
- this.stateName = this.i18n('order.jujuetuiK');
- break;
- case 9:{
- if(this.orderxq.kefuState==0){
- this.stateName = this.i18n('order.kefujs');
- break;
- }
- else{
- if(this.orderxq.kefuRepeat==0){
- //2未受理、1已受理、0已完成
- if(this.orderxq.kefuState==2){
- this.stateName = this.i18n('order.daishouli');
- break;
- }
- if(this.orderxq.kefuState==1){
- this.stateName = this.i18n('order.yishouli');
- break;
- }
- if(this.orderxq.kefuState==0){
- this.stateName = this.i18n('order.shouhwc');
- break;
- }
- }
- else{
- if(this.orderxq.repeatDdId){
- this.stateName = this.i18n('order.chongpaidd')+':'+this.orderxq.repeatDdId;
- break;
- }
- else{
- this.stateName = this.i18n('order.chongpaidd');
- break;
- }
- }
- }
- }
- case 10:
- this.stateName = this.i18n('order.zuofei');
- break;
- case 11:
- this.stateName = this.i18n('order.shouhwc');
- break;
- case 12:
- this.stateName=this.i18n('order.songda');
- break;
- }
-
- if(this.orderxq.type==0){
- this.ordertype = 0;
- this.ordertypename=this.i18n('order.peisong');
- }
- else if(this.orderxq.type==1){
- this.ordertype = 1;
- this.ordertypename=this.i18n('order.ziqu');
- if(this.state==3||this.state==4){
- this.stateName = this.i18n('order.daiqucan');
- }
- }
- else{
- this.ordertype = 2;
- this.ordertypename=this.i18n('shouye.tangshi');
- if(this.state==3||this.state==4){
- this.stateName = this.i18n('order.daiqucan');
- }
- }
- },
-
- dowithMap(){
- this.showMap=0;
- if(this.orderxq.type==0){
- if(this.orderxq.state==3||this.orderxq.state==4||this.orderxq.state==12){
- if(this.orderxq.RiderPosition.cid!=null){
- this.qsCid=this.orderxq.RiderPosition.cid;
- }
- if(this.orderxq.RiderPosition.latitude==0||this.orderxq.RiderPosition.longitude==0){
- return;
- }
- this.showMap=1;
- if(this.mapHeight==0){
- this.mapHeight=500;
- this.scrollHeight=this.scrollHeight-this.mapHeight;
- }
- var that = this;
- setTimeout(function() {
- // 这里写要延时执行的代码
- that.dongtaiJindu();
- that.setpcovers('');
- }, 500);
-
- }
- }
- },
-
- dongtaiJindu(){
- this.timer = setInterval(() => {
- if(this.orderxq.state==3){
- if(this.jinduA>=100){
- this.jinduA=0
- }
- this.jinduA=this.jinduA+3;
- this.jinduB=0;
- }
- if(this.orderxq.state==4){
- if(this.jinduB>=100){
- this.jinduB=0
- }
- this.jinduB=this.jinduB+3;
- this.jinduA=100;
- }
- }, 100);
- },
-
- setpcovers(obj){
- // this.pcovers=[{//门店
- // latitude: this.orderxq.store.latitude,
- // longitude: this.orderxq.store.longitude,
- // iconPath: '/static/images/Bdizhil@3x.png'
- // }];
- if(obj==''){
- this.pcovers=[{//骑手
- latitude: this.orderxq.RiderPosition.latitude,
- longitude: this.orderxq.RiderPosition.longitude,
- iconPath: '/static/images/qishoutb@3x.png'
- }];
- }
- else{
- this.pcovers=[{//骑手
- latitude:obj.latitude,
- longitude:obj.longitude,
- iconPath: '/static/images/qishoutb@3x.png'
- }];
- }
- if(this.orderxq.shaddress){
- var mudi={
- latitude:this.orderxq.shaddress.latitude,
- longitude:this.orderxq.shaddress.longitude,
- iconPath: '/static/images/Bdizhil@3x.png'
- }
- this.pcovers.push(mudi);
- }
- },
-
- callPhone(){
- var that = this;
- uni.showModal({
- cancelText:that.i18n('order.quxiao'),
- confirmText:that.i18n('comp.queren'),
- title: that.i18n('api.message'),
- content:that.i18n('api.nqdbddh'),
- success: function (res) {
- if (res.confirm) { //这里是点击了确定以后
- console.log(that.mendianMs.telphone)
- plus.device.dial(that.mendianMs.telphone, false );
- } else { //这里是点击了取消以后
- console.log('点击取消')
- }
- }
- })
- },
- phoneCall(){
- var that = this;
- uni.showModal({
- cancelText:that.i18n('order.quxiao'),
- confirmText:that.i18n('comp.queren'),
- title: that.i18n('api.message'),
- content:that.i18n('api.nqdbddh'),
- success: function (res) {
- if (res.confirm) { //这里是点击了确定以后
- console.log(that.orderxq.qsuser.phone)
- plus.device.dial(that.orderxq.qsuser.phone, false );
- } else { //这里是点击了取消以后
- console.log('点击取消')
- }
- }
- })
- },
- audioCall(){
- var data = {
- ddId:this.orderxq.ddId,
- userId:this.orderxq.qsId,
- nickName:'',
- avatar:'',
- cid:this.qsCid
- }
- uni.setStorageSync('imUser',data)
- uni.navigateTo({
- url:'/pages/imcall/audioCall?caller=1'
- })
- },
- exchange(){
- var data = {
- ddId:this.orderxq.ddId,
- userId:this.orderxq.qsId,
- nickName:'',
- avatar:'',
- cid:this.qsCid
- }
- uni.setStorageSync('imUser',data)
- uni.navigateTo({
- url:'/pages/imcall/GoeasyExchange?caller=1'
- })
- },
-
- reloadLocate(){
- console.log(this.qsCid)
- if(this.qsCid!=''){
- this.pushMsg(this.qsCid)
- }
- },
- choosebt(index){
- switch(index){
- case 1://去支付
- {
- this.$refs.popzhif.open('bottom');
- //this.zffsS=true;
- }
- break;
- case 2://修改订单
- break;
- case 3://取消订单
- var that = this;
- uni.showModal({
- cancelText:that.i18n('order.quxiao'),
- confirmText:that.i18n('comp.queren'),
- title: that.i18n('api.message'),
- content: that.i18n('order.shifouqx')+that.ddid+'?',
- success: function (res) {
- if (res.confirm) { //这里是点击了确定以后
- that.setorderuzt(10,that.Id);
- } else { //这里是点击了取消以后
- console.log('用户点击取消')
- }
-
- }
- })
- break;
- case 4://发表评论
- //this.setorderuzt(3,this.Id);
- uni.navigateTo({
- url:'/pages/OrderList/pinglun?mendid='+this.mendid+'&ddId='+this.ddid
- })
- break;
- return
- case 5://售后列表
- uni.navigateTo({
- url:'/pages/kehufuwu/kefuMsgList?ddId='+this.orderxq.ddId
- })
- break;
- case 6://完成订单
- var that = this;
- uni.showModal({
- cancelText:that.i18n('order.quxiao'),
- confirmText:that.i18n('comp.queren'),
- title: that.i18n('api.message'),
- content: that.i18n('mend.shifwanch')+that.ddid+that.i18n('index.order')+'?',
- success: function (res) {
- if (res.confirm) { //这里是点击了确定以后
- that.setorderuzt(5,that.Id);
- } else { //这里是点击了取消以后
- console.log('用户点击取消')
- }
-
- }
- })
- break;
- case 7://开始售后
- var that = this;
- uni.showModal({
- cancelText:that.i18n('order.quxiao'),
- confirmText:that.i18n('comp.queren'),
- title: that.i18n('api.message'),
- content: that.i18n('order.shifoushenq')+that.ddid+that.i18n('order.kefujs')+'?',
- success: function (res) {
- if (res.confirm) { //这里是点击了确定以后
- if(that.orderxq.collectPayment==1){
- that.setorderuzt(9,that.Id);
- }
- else{
- that.setorderuzt(6,that.Id);
- }
-
- } else { //这里是点击了取消以后
- console.log('用户点击取消')
- }
-
- }
- })
- break;
- }
- },
-
- setorderuzt(state,id){
- api('setorderuzt',{
- id:id,
- state:state
- },res=>{
- console.log('setorderuzt',res)
- this.getstoreorderxq();
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
-
- //直接全额退款
- quanertuikuan(state){
- console.log('quanertuikuan');
- api('VNtuikuan',{
- "order_id": this.ddid, //需要退款的订单号
- "amount": parseInt(this.amount), //退款金额
- "trantype": '02', //退款类型:02全额退款,03部份退款
- 'illustrate':'全额退款',
- "transaction":'' //交易号,不存在可为空
- },res=>{
- console.log('VNtuikuan',res);
- if(res.data.code==200){
- if(res.data.data.vnp_ResponseCode=='00'){
- uni.showToast({
- title:this.i18n('order.tuikuanchg'),
- icon: 'none',
- duration: 2500
- })
- this.setorderuzt(state,this.Id);
- }else if(res.data.data.vnp_ResponseCode=='94'){
- uni.showToast({
- title:this.i18n('order.tuikuanchg'),
- icon: 'none',
- duration: 2500
- })
- this.setorderuzt(state,this.Id);
- }
- else{
- uni.showToast({
- title: res.data.data.vnp_Message,
- icon: 'none',
- duration: 2500
- })
- }
- }
- else{
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 2500
- })
- }
- },failc=>{
- console.log('VNtuikuan',failc)
- })
- },
-
- huodaofukuan(){
- this.$refs.popzhif.close();
- uni.showLoading({
- title:'Loading...',
- mask:true
- })
- api('setorderuzt',{
- id:this.Id,
- "collectPayment":1
- },res=>{
- console.log('setorderuzt:',res)
- uni.hideLoading();
- if(res.data.code==200){
- this.getstoreorderxq();
- }
- else{
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 2000
- })
- }
- },failc=>{
- uni.hideLoading();
- //console.log('getadvertis----',failc)
- })
- },
- getVNPay(){
- this.$refs.popzhif.close();
- api('setorderuzt',{
- id:this.Id,
- "collectPayment":0
- },res=>{
- if(res.data.code!=200){
- return;
- }
- },failc=>{
- return;
- })
- //this.getVNPay();//支付链接不能重复利用
- if(null==this.orderxq.payUrl ||undefined==this.orderxq.payUrl || this.orderxq.payUrl==''||this.orderxq.payUrl.length<10){
-
- }
- else{
- uni.navigateTo({
- url:'/pages/OrderList/buy/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(this.orderxq.payUrl))+'&ddid='+this.ddid
- })
- return;
- }
- var language = uni.getStorageSync('language');
- var lg;
- if(language=='yuenan'){
- lg='vi';
- }
- else{
- lg='en';
- }
- api('VNPay',{
- orderid:this.ddid,
- amount:parseInt(this.amount),
- language:lg
- },res=>{
- if(res.data.code!=200){
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 3500
- })
- return;
- }
- uni.navigateTo({
- url:'/pages/OrderList/buy/Zhifuyemian?url='+ encodeURIComponent(JSON.stringify(res.data.data))+'&ddid='+this.ddid
- })
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
- //请求位置
- pushMsg(cid){//消息推送
- var payloadData={
- cid:this.cid,
- latitude:'',
- longitude:''
- }
- api('pushMsgQS',{
- cid:cid,
- title:'Request',
- content:'Request location',
- payload:payloadData
- },res=>{
- console.log(res)
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- },
- selectImage(){
- console.log('selectImage');
- this.upImage=true;
- var that = this;
- uni.chooseImage({
- count: 1, // 图片数量
- sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album'], //从相册选择或者拍照
- success: (res) => {
- const tempFilePaths = res.tempFilePaths;
- console.log('-----',tempFilePaths)
- uni.uploadFile({
- url:'https://api.cityexpress168.com.vn/utils/Upload', //上传图片api
- // url:'https://cteapi.waimai-paotui.com/utils/Upload', //上传图片api
-
- filePath: tempFilePaths[0],
- name: 'file',
- header:{
- //"Authorization": userinfo.token
- },
- success: (res) => {
- this.upImage=false;
- let group = JSON.parse(res.data);
- that.annexes=group.data;
- console.log('aaaa',group)
- api('ADDaddress',{
- id:that.orderxq.shaddress.id,
- annexes:group.data
- },
- res=>{
- if(res.data.code==200){
-
- }
- console.log('getGoodsDetail:',res);
- },failc=>{
- //console.log('getadvertis----',failc)
- })
- uni.showToast({
- title:'success',
- icon:"success"
- })
- },
- fail: (res) =>{
- console.log('uni.uploadFile',res)
- this.upImage=false;
- }
- });
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- .spaceCtv{
- width:690upx;
- margin-left: 30upx;
- align-items: center;
- height: 80rpx;
- border-bottom-width: 2rpx;
- border-bottom-color:lightgray;
- }
- .spaceCtvh{
- width:690upx;
- margin-left: 30upx;
- align-items: center;
- height: 150rpx;
- border-bottom-width: 2rpx;
- border-bottom-color:lightgray;
- }
- .spaceCtvauto{
- width:690upx;
- margin-left: 30upx;
- justify-content: flex-start;
- border-bottom-width: 2rpx;
- border-bottom-color:lightgray;
- }
- .spaceCtvN{
- width:690upx;
- margin-left: 30upx;
- align-items: center;
- height: 80rpx;
- }
- .mapcontent{
- position: fixed;
- height: 400rpx;
- left: 0;
- right: 0;
- z-index: 999;
- }
- .mapview{
- display: flex;
- width: 750upx;
- }
- .contentV{
- width:690upx;
- margin-left: 30upx;
- margin-top: 20rpx;
- }
- .viewinrow{
- display: flex;
- flex-direction: row;
- align-items: center;
- }
-
- .topActV{
- width: 750upx;
- height: 180rpx;
- background-color: white;
- }
- .topActVB{
- width: 750upx;
- height: 180rpx;
- background-color: white;
- }
- .notext{
- padding-top: 10rpx;
- padding-left: 20rpx;
- font-size: 40rpx;
- color: #000;
- font-weight:bold;
- }
- .nodetail{
- height: 88rpx;
- margin-left: 10rpx;
- margin-right: 10rpx;
- margin-top: 10rpx;
- padding-left: 2rpx;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- background-color: #F1F1F1;
- font-size: 30rpx;
- }
- .xingimage{
- width: 36rpx;
- height: 36rpx;
- }
- .actBTVS{
- display: flex;
- flex-direction: row;
- justify-content:space-between;
- align-items: center;
- width: 650upx;
- margin-left: 15rpx;
- }
- .actBTV{
- width: 720upx;
- margin-left: 15upx;
- display: flex;
- flex-direction: row;
- justify-content:space-between;
- align-items: center;
- }
- .actbt{
- width: 160upx;
- margin-top: 10rpx;
- margin-bottom: 10rpx;
- align-items: center;
- justify-content: center;
- }
- .ddbticon{
- margin-top: 6rpx;
- width: 160upx;
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .ddtext{
- margin-top: 6rpx;
- text-align: center;
- color: black;
- }
-
- .bticon{
- width: 50rpx;
- height: 50rpx;
- }
- .spnodetail{
- display: flex;
- flex-direction: row;
- align-items: center;
- background-color: white;
- margin-top: 20rpx;
- margin-bottom: 20rpx;
- }
- .spIcon{
- margin: 20rpx;
- width: 90rpx;
- height: 90rpx;
- }
- .xiaoji{
- margin-right: 30rpx;
- }
- .kouweisku{
- padding-right: 10rpx;
- color: chocolate;
- font-size: 26rpx;
- width: 600upx;
- }
- .linesp{
- width: 750upx;
- height: 8rpx;
- background-color: aliceblue;
- }
- .buyGoodsv{
- width: 750upx;
- text-align: left;
- height: 60rpx;
- line-height: 60rpx;
- padding-left: 10rpx;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- .stattypeD{
- color: black;
- font-weight: bold;
- font-size: 26rpx;
- margin-left: 10rpx;
- }
- .stattypeA{
- color: darkgray;
- font-size: 26rpx;
- margin-left: 10rpx;
- }
- .stattype{
- font-size: 26rpx;
- margin-right: 40rpx;
- }
- .pinglun{
- margin: 16rpx;
- padding: 10rpx;
- width:660upx;
- border-radius: 15rpx;
- border: 2rpx solid lightgray;
- }
- .zhifbut{
- text-align:center;
- margin-top: 12rpx;
- margin-bottom: 12rpx;
- width:660upx;
- border-radius: 10rpx;
- color: white;
- line-height: 70rpx;
- }
- .adrrTextV{
- padding-top: 6rpx;
- padding-bottom: 6rpx;
- width:680upx;
- }
- .foodNameV{
- font-size: 30rpx;
- width:500upx;
- }
- </style>
|