jiesuanYe.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042
  1. <template>
  2. <view class="contentV">
  3. <customNav :shownav="true" :title="$t('index.xiadanzhifu')" titledetl=""></customNav>
  4. <view class="ctinrow">
  5. <view class="topSwichV" :style="{backgroundColor:Bcolor}" @click="peisong">
  6. <view class="topSwichV">
  7. <image class="toppz" :src="peisongimg" mode="widthFix"></image>
  8. <text class="toppztext" :style="{color:Tcolor}">{{$t('order.peisong')}}</text>
  9. </view>
  10. </view>
  11. <view class="topSwichVL" :style="{backgroundColor:Bcolorr}" @click="ziqu">
  12. <view class="topSwichVL">
  13. <image class="toppz" :src="ziquimg" mode="widthFix"></image>
  14. <text class="toppztext" :style="{color:Tcolorr}">{{$t('order.ziqu')}}</text>
  15. </view>
  16. </view>
  17. <!-- <view class="topSwichVL" :style="{backgroundColor:Bcolorrr}" @click="tangshi">
  18. <view class="topSwichVL">
  19. <image class="toppz" :src="tangshiimg" mode="widthFix"></image>
  20. <text class="toppztext" :style="{color:Tcolorrr}">{{$t('shouye.tangshi')}}</text>
  21. </view>
  22. </view> -->
  23. </view>
  24. <label class="linesp"></label>
  25. <uni-list v-if="showAdrr==0">
  26. <uni-list-item :title="dizhiID.address" :note="dizhiID.phone" :rightText="dizhiID.name"
  27. thumb="/static/images/dizhil@3x.png" thumb-size="sm" @click="changaddr" link></uni-list-item>
  28. </uni-list>
  29. <uni-list>
  30. <uni-list-item :title="delryTime.length>0?$t('order.yuyueshijian'):$t('order.jinkuaisd')"
  31. :note="delryTime.length>0?delryTime:('10~20 '+$t('order.Xfenzhongsd'))"
  32. :rightText="$t('order.yuyueshijian')" thumb="/static/images/time@3x.png" thumb-size="sm"
  33. @click="yuyueshijian" link></uni-list-item>
  34. </uni-list>
  35. <label class="linesp"></label>
  36. <label class="linesp"></label>
  37. <uni-list>
  38. <uni-list-item :title="$t('index.goodslist')"></uni-list-item>
  39. </uni-list>
  40. <view v-for="(item,findex) in foodlist">
  41. <view class="spnodetail">
  42. <view class="">
  43. <myImage class="spIcon" :mysrc="item.image" mymode="scaleToFill"></myImage>
  44. </view>
  45. <view style="width: 82%;">
  46. <view class="actBTV">
  47. <view style="font-size: 30rpx;width: 100%;">
  48. <text class="text2row" style="width: 100%;">{{item.name}}</text>
  49. </view>
  50. <view class="contentInRowL">
  51. <image v-if="item.number>0" class="imageRJ" src="/static/images/jian@3x.png"
  52. mode="aspectFit" @click="jiajian(findex,-1)"></image>
  53. <text v-if="item.number>0" class="textR">{{item.number}}</text>
  54. <image class="imageR" src="/static/images/plus-circle-fill@3x.png" mode="aspectFit"
  55. @click="jiajian(findex,1)"></image>
  56. </view>
  57. </view>
  58. <view class="actBTV">
  59. <view style="font-size: 26rpx;color: blueviolet;">{{$t('shangpin.shoujia')}}:
  60. {{$formPr(item.price+item.otherPrice)}}{{$t('locale.huobidw')}}
  61. </view>
  62. <view class="xiaoji" style="font-size: 28rpx;color: brown;">{{$t('shangpin.xiaoji')}}:
  63. {{$formPr((item.price+item.otherPrice)*item.number)}}{{$t('locale.huobidw')}}
  64. </view>
  65. </view>
  66. <view class="viewinrow">
  67. <text class="kouweisku">{{arraytoStr(item.ask)}}</text>
  68. </view>
  69. <view v-if="item.beizhu" class="">
  70. <text style="font-size: 30rpx;color:#00A6FF;">{{item.beizhu}}</text>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <label class="linesp"></label>
  76. <label class="linesp"></label>
  77. <view style="background-color:white;width: 100%;">
  78. <view class="contentInRowS shifdf" @click="xuanzcux">
  79. <view class="contentInRowL" style="width: 86%;">
  80. <image style="width: 50rpx;height: 50rpx;" src="/static/images/hongbkqh@3x.png" mode="scaleToFill">
  81. </image>
  82. <view class="contentColumn" style="width: 100%;">
  83. <text class="shifdftext"
  84. :style="youyh?'color:fuchsia;':'color:darkgray;'">{{$t('index.hongbaokq')}}</text>
  85. <text class="hdts" style="color: black;font-size: 26rpx;">{{yhhd}}</text>
  86. </view>
  87. </view>
  88. <image v-if="hyyh!=0" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png"
  89. mode="scaleToFill"></image>
  90. </view>
  91. </view>
  92. <!-- <view style="background-color:white;width: 100%;">
  93. <view class="contentInRowS shifdf" @click="jifenduihuan">
  94. <view class="contentInRowL" style="width: 86%;">
  95. <image style="width: 50rpx;height: 50rpx;" src="/static/images/hongbkqh@3x.png" mode="scaleToFill"></image>
  96. <view class="contentColumn" style="width: 100%;">
  97. <text class="shifdftext" :style="isjifenduihan?'color:green;':'color:darkgray;'">积分兑换</text>
  98. <text v-if="points>0" class="hdts" style="color: black;font-size: 26rpx;">{{points}}积分兑换{{pointsReduction}}</text>
  99. </view>
  100. </view>
  101. <image v-if="isjifenduihan" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png" mode="scaleToFill"></image>
  102. </view>
  103. </view> -->
  104. <view class="contentInRowS shifdf" @click="shifodaofu">
  105. <view class="contentInRowC">
  106. <image style="width: 50rpx;height: 50rpx;" src="/static/images/payflact@3x.png" mode="scaleToFill">
  107. </image>
  108. <text class="shifdftext"
  109. :style="shifoudf==0?'color:darkgray;':'color:fuchsia;'">{{$t('index.huodaofukan')}}</text>
  110. </view>
  111. <image v-if="shifoudf==1" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png"
  112. mode="scaleToFill"></image>
  113. </view>
  114. <label class="linesp"></label>
  115. <label class="linesp"></label>
  116. <uni-list>
  117. <uni-list-item :title="$t('order.beizhu')"></uni-list-item>
  118. </uni-list>
  119. <textarea class="pinglun" :placeholder="$t('order.srddbz')" :value="remarks" @input="sumfontnum"></textarea>
  120. <label class="linesp"></label>
  121. <label class="linesp"></label>
  122. <!-- <view v-if="showAdrr==0">
  123. <uni-list>
  124. <uni-list-item :title="$t('order.menpaizp')"></uni-list-item>
  125. </uni-list>
  126. <view class="contentColumnC" style="margin-top: 30rpx;" @click="selectImage">
  127. <netImage width="640" height="640" :mysrc="mpImage" mymode="scaleToFill"></netImage>
  128. </view>
  129. <view class="linesp" style="margin-top: 20rpx;"></view>
  130. <label class="linesp"></label>
  131. </view> -->
  132. <uni-list>
  133. <uni-list-item :title="$t('order.shangpinxj')" :rightText="$formPr(spxj)+$t('locale.huobidw')" />
  134. <uni-list-item :title="$t('order.peisongfei')" :rightText="$formPr(psf)+$t('locale.huobidw')" />
  135. <uni-list-item :title="$t('order.youhuijine')" :rightText="'-'+$formPr(hyyh)+$t('locale.huobidw')" />
  136. </uni-list>
  137. <label class="linesp"></label>
  138. <label class="linesp"></label>
  139. <uni-list>
  140. <uni-list-item :title="$t('order.zhifujine')" :rightText="$formPr(zje)+$t('locale.huobidw')" />
  141. </uni-list>
  142. <label class="linesp"></label>
  143. <label class="linesp"></label>
  144. <view class="delbtct">
  145. <view class="delbt" @click="qufukuan">
  146. <label>{{actTitle}}</label>
  147. </view>
  148. </view>
  149. <label class="linesp"></label>
  150. <liu-delivery-time @change="changeTime" @close="deliveryclose" ref="chooseTime"
  151. :title="$t('order.yuyueshijian')"></liu-delivery-time>
  152. <yhdslCropper ref="yhdslCropper" :quality="1" mode="scale" @uploadImg="uploadImg" :scale="scale"></yhdslCropper>
  153. <popViewGG :show="showpop" :acttips="$t('order.queding')" :maskClosable="true" :isCancel="false"
  154. @chooseCancel="chooseCancel">
  155. <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
  156. <view class="contentColumnC" style="height: 80rpx;width: 100%;background-color: lightgray;">
  157. <view class="contentInRowS" style="height: 80rpx;width: 90%;">
  158. <text style="font-size: 30rpx;color: crimson;" @click="querenyhhd"></text>
  159. <text style="font-size: 28rpx;">{{$t('index.hongbaokq')}}</text>
  160. <text style="font-size: 30rpx;color: #00A6FF;"
  161. @click="querenyhhd">{{$t('order.queding')}}</text>
  162. </view>
  163. </view>
  164. <view v-if="cxList.length>0" style="width: 90%;">
  165. <checkbox-group @change="hdradioChange">
  166. <label class="contentColumn" style="margin-top: 16rpx;" v-for="(item, index) in cxList"
  167. :key="index">
  168. <checkbox :value="item.id" :checked="item.id === hdidpt||item.id === hdidsj">
  169. <view class="contentColumn" :style="item.type==0?'color: #00A6FF;':'color:green;'">
  170. <text style="font-size: 28rpx;">{{item.salesName}}</text>
  171. <text style="font-size: 28rpx;">{{getNote(item,0)}}</text>
  172. </view>
  173. </checkbox>
  174. </label>
  175. </checkbox-group>
  176. </view>
  177. <view v-if="kqList.length>0" style="width: 90%;">
  178. <checkbox-group @change="kaqradioChange">
  179. <label class="contentColumn" style="margin-top: 16rpx;" v-for="(item, index) in kqList"
  180. :key="index">
  181. <checkbox :value="item.id" :checked="item.id === kqidpt||item.id === kqidsj">
  182. <view class="contentColumn" :style="item.type==0?'color: #00A6FF;':'color:green;'">
  183. <text style="font-size: 28rpx;">{{item.name}}</text>
  184. <text style="font-size: 28rpx;">{{getNote(item,1)}}</text>
  185. </view>
  186. </checkbox>
  187. </label>
  188. </checkbox-group>
  189. </view>
  190. <view class="contentInRowC" style="width: 100%;height: 80rpx;margin-top: 16rpx;">
  191. <text>{{$t('hongbaokq.leijiyh')}} {{hyyh}}{{$t('locale.huobidw')}}</text>
  192. </view>
  193. <view style="height: 80rpx;"></view>
  194. </view>
  195. </popViewGG>
  196. <popViewGG :tips="$t('order.zhifufangshi')" :show="zffsS" :showbotom="false" :maskClosable="true"
  197. :isCancel="true" @chooseCancel="chooseCancel">
  198. <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
  199. <view class="zhifbut" style="background-color: deeppink;" @click="huodaofukuan">
  200. {{$t('index.huodaofukan')}}
  201. </view>
  202. <!-- <view class="zhifbut" style="background-color:#00A6FF;" @click="getVNPay">VNPAY</view> -->
  203. </view>
  204. </popViewGG>
  205. </view>
  206. </template>
  207. <script>
  208. import uniList from '@/uni_modules/uni-list/uni-list.vue';
  209. import uniListItem from '@/uni_modules/uni-list-item/uni-list-item.vue';
  210. // import uniAd from '@/uni_modules/uni-list-ad/uni-list-ad.vue';
  211. // import uniChat from '@/uni_modules/uni-list-chat/uni-list-chat.vue';
  212. import yhdslCropper from '@/components/yhdsl-cropper/yhdsl-cropper.vue';
  213. import api from "@/pages/api/api.js"
  214. export default {
  215. components: {
  216. uniList,
  217. uniListItem,
  218. yhdslCropper
  219. },
  220. data() {
  221. return {
  222. mendid: 0,
  223. userid: 0,
  224. ddId: '',
  225. rId: '',
  226. showAdrr: 0,
  227. foodlist: [],
  228. Bcolor: 'whitesmoke',
  229. Bcolorr: 'lightgray',
  230. Bcolorrr: 'lightgray',
  231. Tcolor: 'black',
  232. Tcolorr: 'darkgray',
  233. Tcolorrr: 'darkgray',
  234. peisongimg: '/static/images/peisongh@3x.png',
  235. ziquimg: '/static/images/ziqu@3x.png',
  236. tangshiimg: '/static/images/tangshih.png',
  237. actTitle: this.$t('order.querendd'),
  238. actType: 0,
  239. remarks: '',
  240. spxj: 0.00,
  241. psf: 0.00,
  242. freight: 0.00,
  243. hyyh: 0.00,
  244. zje: 0.00,
  245. jvli: 0.00,
  246. zhixianjuli: 0.00,
  247. zhixianfreight: 0.00,
  248. dizhiID: '',
  249. addrList: [],
  250. peisongdizhiaddress: '',
  251. peisongdizhiname: '',
  252. peisongdizhiphone: '',
  253. zfindex: 0,
  254. delryTime: '',
  255. isGetyunfei: false,
  256. mendianMs: '',
  257. cid: '',
  258. orderDetl: '',
  259. shifouzhifu: false,
  260. zhifuUrl: '',
  261. shifoudf: 0,
  262. scale: 1,
  263. baseUrl: this.$baseImagurl,
  264. mpImage: '',
  265. showpop: false,
  266. indicatorStyle: 'height: 50px;',
  267. zffsS: false,
  268. keyixd: true,
  269. cxList: [],
  270. hdidpt: 0, //平台促销活动id
  271. hdidsj: 0, //门店促销活动id
  272. kqList: [],
  273. kqidpt: 0, //平台使用优惠券id
  274. kqidsj: 0, //门店优惠券id
  275. yhhd: '',
  276. youyh: false,
  277. discountAmount: 0, //平台优惠券优惠金额
  278. salesReduction: 0, //平台促销減免值
  279. mdDiscountAmount: 0, //门店优惠券优惠金额
  280. mdSalesReduction: 0, //门店促销減免值
  281. isjifenduihan: false,
  282. sumpoints: 0, //全部积分
  283. pointsBl: 0, //积分抵扣比例
  284. points: 0, //抵扣的积分
  285. pointsReduction: 0 //积分抵扣值
  286. }
  287. },
  288. onLoad(option) {
  289. this.foodlist = uni.getStorageSync("JSfoodlist");
  290. uni.setStorageSync('JSfoodlist', '');
  291. this.mendid = option.mendid;
  292. this.userid = option.userid;
  293. this.cid = uni.getStorageSync("cid");
  294. this.cuxiaoList();
  295. //this.getPoint();
  296. },
  297. onShow() {
  298. var temp = uni.getStorageSync("peisongdizhi");
  299. if (undefined == temp || null == temp || '' == temp) {
  300. this.dizhiID = '';
  301. //this.getaddressList();
  302. } else {
  303. this.dizhiID = temp;
  304. this.mpImage = this.dizhiID.annexes;
  305. }
  306. this.isGetyunfei = false;
  307. if (this.mendianMs == '') {
  308. this.getmendianDetail(this.mendid);
  309. } else {
  310. if (this.dizhiID == '') {
  311. this.getaddressList();
  312. } else {
  313. console.log('4444')
  314. this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
  315. }
  316. }
  317. if (this.shifouzhifu) {
  318. this.shifouzhifu = false;
  319. this.getorderDetl();
  320. }
  321. },
  322. methods: {
  323. // 检测是否为安卓设备
  324. isAndroidDevice() {
  325. // 在H5环境中检测
  326. // #ifdef H5
  327. const ua = navigator.userAgent.toLowerCase();
  328. return ua.indexOf('android') > -1;
  329. // #endif
  330. // 在App环境中检测
  331. // #ifdef APP-PLUS
  332. return plus.os.name === 'Android';
  333. // #endif
  334. // 其他环境默认返回false
  335. return false;
  336. },
  337. // 安卓设备自动下载并安装APK
  338. downloadAndInstallAndroid(androidUrl) {
  339. const that = this;
  340. // 显示下载提示
  341. uni.showLoading({
  342. title: '正在下载应用...',
  343. mask: true
  344. });
  345. // 在App环境中使用plus.downloader
  346. // #ifdef APP-PLUS
  347. const appDownloadTask = plus.downloader.createDownload(androidUrl, {
  348. filename: '_downloads/CTE.apk'
  349. }, function(download, status) {
  350. uni.hideLoading();
  351. if (status === 200) {
  352. // 下载成功,尝试安装
  353. that.installAndroidApp(download.filename);
  354. } else {
  355. uni.showToast({
  356. title: '下载失败,请重试',
  357. icon: 'none',
  358. duration: 2000
  359. });
  360. }
  361. });
  362. // 监听下载进度
  363. appDownloadTask.addEventListener('statechanged', function(download, status) {
  364. if (status === 200) {
  365. const progress = Math.round((download.downloadedSize / download.totalSize) * 100);
  366. uni.showLoading({
  367. title: `下载中 ${progress}%`,
  368. mask: true
  369. });
  370. }
  371. });
  372. appDownloadTask.start();
  373. // #endif
  374. // 在H5环境中使用uni.downloadFile
  375. // #ifdef H5
  376. const h5DownloadTask = uni.downloadFile({
  377. url: androidUrl,
  378. success: function(res) {
  379. uni.hideLoading();
  380. if (res.statusCode === 200) {
  381. // 下载成功,尝试安装
  382. that.installAndroidApp(res.tempFilePath);
  383. } else {
  384. uni.showToast({
  385. title: '下载失败,请重试',
  386. icon: 'none',
  387. duration: 2000
  388. });
  389. }
  390. },
  391. fail: function(err) {
  392. uni.hideLoading();
  393. console.log('下载失败:', err);
  394. // 下载失败时,提供手动下载选项
  395. uni.showModal({
  396. title: '下载失败',
  397. content: '自动下载失败,是否手动下载?',
  398. success: function(res) {
  399. if (res.confirm) {
  400. // 使用浏览器打开下载链接
  401. window.open(androidUrl, '_blank');
  402. }
  403. }
  404. });
  405. }
  406. });
  407. // 监听下载进度
  408. h5DownloadTask.onProgressUpdate(function(res) {
  409. const progress = Math.round(res.progress);
  410. uni.showLoading({
  411. title: `下载中 ${progress}%`,
  412. mask: true
  413. });
  414. });
  415. // #endif
  416. },
  417. // 安装安卓应用
  418. installAndroidApp(filePath) {
  419. const that = this;
  420. // 在App环境中,直接尝试安装APK
  421. // #ifdef APP-PLUS
  422. uni.showModal({
  423. title: '下载完成',
  424. content: '应用已下载完成,是否立即安装?',
  425. success: function(res) {
  426. if (res.confirm) {
  427. // 使用plus.runtime.install安装APK
  428. plus.runtime.install(filePath, {
  429. force: false
  430. }, function() {
  431. uni.showToast({
  432. title: '安装成功',
  433. icon: 'success',
  434. duration: 2000
  435. });
  436. }, function(e) {
  437. console.log('安装失败:', e);
  438. uni.showModal({
  439. title: '安装失败',
  440. content: '自动安装失败,请手动安装。是否打开文件管理器?',
  441. success: function(res) {
  442. if (res.confirm) {
  443. // 打开文件管理器
  444. plus.runtime.openFile(filePath);
  445. }
  446. }
  447. });
  448. });
  449. }
  450. }
  451. });
  452. // #endif
  453. // 在H5环境中,提示用户手动安装
  454. // #ifdef H5
  455. uni.showModal({
  456. title: '下载完成',
  457. content: '应用已下载完成,请点击下载的文件进行安装',
  458. showCancel: false,
  459. success: function(res) {
  460. if (res.confirm) {
  461. // 尝试打开下载链接,让用户手动下载
  462. window.open(filePath, '_blank');
  463. }
  464. }
  465. });
  466. // #endif
  467. },
  468. // 下载iOS应用
  469. downloadIOSApp(iosUrl) {
  470. // 检测是否为iOS设备
  471. const isIOS = this.isIOSDevice();
  472. if (!isIOS) {
  473. // 非iOS设备直接打开浏览器链接
  474. window.open('https://apps.apple.com/cn/app/cte/id6468907188', '_blank');
  475. return;
  476. }
  477. // 在App环境中使用plus.runtime.openURL
  478. // #ifdef APP-PLUS
  479. plus.runtime.openURL(
  480. 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
  481. (res) => {
  482. console.log('打开 App Store 成功')
  483. },
  484. (err) => {
  485. console.log('打开 App Store 失败,尝试浏览器打开')
  486. // 如果 itms-apps:// 失败,回退到浏览器打开
  487. plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
  488. }
  489. );
  490. // #endif
  491. // 在H5环境中,针对iOS设备优化
  492. // #ifdef H5
  493. // 先尝试直接打开App Store链接
  494. const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
  495. // 尝试多种方式打开App Store
  496. this.tryOpenAppStore(appStoreUrl);
  497. // #endif
  498. },
  499. // 检测是否为iOS设备
  500. isIOSDevice() {
  501. // #ifdef H5
  502. const ua = navigator.userAgent.toLowerCase();
  503. return /iphone|ipad|ipod/.test(ua);
  504. // #endif
  505. // #ifdef APP-PLUS
  506. return plus.os.name === 'iOS';
  507. // #endif
  508. return false;
  509. },
  510. // 尝试打开App Store的多种方式
  511. tryOpenAppStore(appStoreUrl) {
  512. // 方法1: 直接使用window.open
  513. const newWindow = window.open(appStoreUrl, '_blank');
  514. // 如果新窗口被阻止,尝试其他方法
  515. if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
  516. // 方法2: 尝试使用itms-apps协议
  517. this.tryItmsProtocol();
  518. }
  519. },
  520. // 尝试使用itms-apps协议
  521. tryItmsProtocol() {
  522. const itmsUrl = 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188';
  523. // 创建一个隐藏的iframe来尝试打开itms-apps协议
  524. const iframe = document.createElement('iframe');
  525. iframe.style.display = 'none';
  526. iframe.style.width = '1px';
  527. iframe.style.height = '1px';
  528. iframe.src = itmsUrl;
  529. document.body.appendChild(iframe);
  530. // 设置超时,如果App Store没有打开,则回退到浏览器
  531. setTimeout(() => {
  532. if (document.body.contains(iframe)) {
  533. document.body.removeChild(iframe);
  534. }
  535. // 最后回退到浏览器打开
  536. window.location.href = 'https://apps.apple.com/cn/app/cte/id6468907188';
  537. }, 1500);
  538. },
  539. //促销
  540. cuxiaoList() {
  541. this.youyh = false;
  542. this.yhhd = '';
  543. var price = 0;
  544. for (var i = 0; i < this.foodlist.length; i++) {
  545. price = price + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i].number;
  546. }
  547. this.cxList = [];
  548. api('cuxiaoList', {
  549. mdId: this.mendid,
  550. price: price,
  551. yfPrice: this.psf
  552. }, r => {
  553. console.log(r);
  554. console.log('-----------1', this.mendid, price, this.psf)
  555. if (r.data.code == 200) {
  556. this.cxList = r.data.data;
  557. if (this.cxList.length > 0) {
  558. this.yhhd = this.$t('order.qingxzyhkq');
  559. this.youyh = true;
  560. }
  561. }
  562. this.jisuanjiner();
  563. this.kaquanList();
  564. }, failc => {
  565. //console.log('getadvertis----',failc)
  566. })
  567. },
  568. kaquanList() {
  569. var price = 0;
  570. for (var i = 0; i < this.foodlist.length; i++) {
  571. price = price + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i].number;
  572. }
  573. this.kqList = [];
  574. api('orderyhList', {
  575. mdId: this.mendid,
  576. price: price,
  577. yfPrice: this.psf
  578. }, r => {
  579. console.log(r);
  580. console.log('-----------2', this.mendid, price, this.psf)
  581. if (r.data.code == 200) {
  582. this.kqList = r.data.data;
  583. if (this.kqList.length > 0) {
  584. this.yhhd = this.$t('order.qingxzyhkq');
  585. this.youyh = true;
  586. } else {
  587. if (!this.youyh) {
  588. this.yhhd = '';
  589. this.youyh = false;
  590. }
  591. }
  592. }
  593. this.jisuanjiner();
  594. }, failc => {
  595. //console.log('getadvertis----',failc)
  596. })
  597. },
  598. //积分
  599. getPoint() {
  600. api('getPoint', {}, r => {
  601. console.log("getPoint:", r);
  602. if (r.data.code == 200) {
  603. this.sumpoints = r.data.data.points; //积分
  604. this.pointsBl = r.data.data.bl; //积分抵扣值
  605. } else if (r.data.code == 500) {
  606. this.sumpoints = 0; //积分
  607. this.pointsBl = 0; //积分抵扣值
  608. }
  609. }, failc => {
  610. //console.log('getadvertis----',failc)
  611. })
  612. },
  613. hdradioChange(evt) {
  614. console.log(evt.detail.value)
  615. var hdids = evt.detail.value;
  616. var hdid = 0;
  617. var hdidpt = 0;
  618. var hdidsj = 0;
  619. for (var i = 0; i < hdids.length; i++) {
  620. var oid = hdids[i];
  621. if (oid == this.hdidpt) {
  622. hdidpt = oid;
  623. } else if (oid == this.hdidsj) {
  624. hdidsj = oid;
  625. } else {
  626. hdid = oid;
  627. }
  628. }
  629. this.hdidpt = hdidpt;
  630. this.hdidsj = hdidsj;
  631. var sobj = null;
  632. for (var i = 0; i < this.cxList.length; i++) {
  633. var obj = this.cxList[i];
  634. if (obj.id == hdid) {
  635. sobj = obj;
  636. break;
  637. }
  638. }
  639. if (this.cxList.length > 0 && hdid > 0) {
  640. for (var i = 0; i < this.cxList.length; i++) {
  641. var obj = this.cxList[i];
  642. if (obj.id == this.hdidpt) {
  643. if (sobj.salesType == obj.salesType) {
  644. this.hdidpt = 0;
  645. }
  646. }
  647. if (obj.id == this.hdidsj) {
  648. if (sobj.salesType == obj.salesType) {
  649. this.hdidsj = 0;
  650. }
  651. }
  652. }
  653. }
  654. if (this.kqList.length > 0 && hdid > 0) {
  655. for (var i = 0; i < this.kqList.length; i++) {
  656. var obj = this.kqList[i];
  657. if (obj.id == this.kqidpt) {
  658. if (sobj.salesType == obj.yhfangs) {
  659. this.kqidpt = 0;
  660. }
  661. }
  662. if (obj.id == this.kqidsj) {
  663. if (sobj.salesType == obj.yhfangs) {
  664. this.kqidsj = 0;
  665. }
  666. }
  667. }
  668. }
  669. if (hdid > 0) {
  670. if (sobj && sobj.type == 0) {
  671. this.hdidpt = hdid;
  672. } else if (sobj && sobj.type == 1) {
  673. this.hdidsj = hdid;
  674. }
  675. }
  676. this.jisuanjiner();
  677. },
  678. kaqradioChange(evt) {
  679. console.log(evt)
  680. var kqids = evt.detail.value;
  681. var kqid = 0;
  682. var kqidpt = 0;
  683. var kqidsj = 0;
  684. for (var i = 0; i < kqids.length; i++) {
  685. var oid = kqids[i];
  686. if (oid == this.kqidpt) {
  687. kqidpt = oid;
  688. } else if (oid == this.kqidsj) {
  689. kqidsj = oid;
  690. } else {
  691. kqid = oid;
  692. }
  693. }
  694. this.kqidpt = kqidpt;
  695. this.kqidsj = kqidsj;
  696. var sobj = null;
  697. for (var i = 0; i < this.kqList.length; i++) {
  698. var obj = this.kqList[i]
  699. if (obj.id == kqid) {
  700. sobj = obj;
  701. break;
  702. }
  703. }
  704. if (this.cxList.length > 0 && kqid > 0) {
  705. for (var i = 0; i < this.cxList.length; i++) {
  706. var obj = this.cxList[i];
  707. if (obj.id == this.hdidpt) {
  708. if (sobj.yhfangs == obj.salesType) {
  709. this.hdidpt = 0;
  710. }
  711. }
  712. if (obj.id == this.hdidsj) {
  713. if (sobj.yhfangs == obj.salesType) {
  714. this.hdidsj = 0;
  715. }
  716. }
  717. }
  718. }
  719. if (this.kqList.length > 0 && kqid > 0) {
  720. for (var i = 0; i < this.kqList.length; i++) {
  721. var obj = this.kqList[i];
  722. if (obj.id == this.kqidpt) {
  723. if (sobj.yhfangs == obj.yhfangs) {
  724. this.kqidpt = 0;
  725. }
  726. }
  727. if (obj.id == this.kqidsj) {
  728. if (sobj.yhfangs == obj.yhfangs) {
  729. this.kqidsj = 0;
  730. }
  731. }
  732. }
  733. }
  734. if (kqid >= 0) {
  735. if (sobj && sobj.type == 0) {
  736. this.kqidpt = kqid;
  737. } else if (sobj && sobj.type == 1) {
  738. this.kqidsj = kqid;
  739. }
  740. }
  741. this.jisuanjiner();
  742. },
  743. getNote(obj, index) {
  744. var str = '';
  745. if (index == 0) {
  746. var str = '';
  747. if (obj.salesType == 1 && obj.salesReduction > 1) { //优惠方式:1 运费,2 订单 ,3 商品
  748. str = this.$t('hongbaokq.yunfeiyh');
  749. }
  750. if (obj.salesType == 1 && obj.salesReduction < 1 && obj.salesReduction > 0) { //优惠方式:1 运费,2 订单 ,3 商品
  751. str = this.$t('hongbaokq.yunfeizk');
  752. }
  753. if (obj.salesType == 1 && obj.salesReduction == 0) { //优惠方式:1 运费,2 订单 ,3 商品
  754. str = this.$t('hongbaokq.yunfeiquanm');
  755. }
  756. if (obj.salesType == 2 && obj.salesReduction > 1) {
  757. str = this.$t('hongbaokq.dingdanyh');
  758. }
  759. if (obj.salesType == 2 && obj.salesReduction < 1) {
  760. str = this.$t('hongbaokq.dingdanzk');
  761. }
  762. if (obj.salesType == 3 && obj.salesReduction > 1) {
  763. str = this.$t('hongbaokq.shangpinyh');
  764. }
  765. if (obj.salesType == 3 && obj.salesReduction < 1) {
  766. str = this.$t('hongbaokq.shangpinzk');
  767. }
  768. if (obj.salesReduction != 0) {
  769. str = str + ' ' + obj.salesReduction;
  770. }
  771. }
  772. if (index == 1) {
  773. if (obj.yhfangs == 1 && obj.yhnum > 1) { //优惠方式:1 运费,2 订单 ,3 商品
  774. str = this.$t('hongbaokq.yunfeiyh');
  775. }
  776. if (obj.yhfangs == 1 && obj.yhnum < 1 && obj.yhnum > 0) { //优惠方式:1 运费,2 订单 ,3 商品
  777. str = this.$t('hongbaokq.yunfeizk');
  778. }
  779. if (obj.yhfangs == 1 && obj.yhnum == 0) { //优惠方式:1 运费,2 订单 ,3 商品
  780. str = this.$t('hongbaokq.yunfeiquanm');
  781. }
  782. if (obj.yhfangs == 2 && obj.yhnum > 1) {
  783. str = this.$t('hongbaokq.dingdanyh');
  784. }
  785. if (obj.yhfangs == 2 && obj.yhnum < 1) {
  786. str = this.$t('hongbaokq.dingdanzk');
  787. }
  788. if (obj.yhfangs == 3 && obj.yhnum > 1) {
  789. str = this.$t('hongbaokq.shangpinyh');
  790. }
  791. if (obj.yhfangs == 3 && obj.yhnum < 1) {
  792. str = this.$t('hongbaokq.shangpinzk');
  793. }
  794. if (obj.yhnum != 0) {
  795. str = str + ' ' + obj.yhnum;
  796. }
  797. }
  798. return str;
  799. },
  800. querenyhhd() {
  801. this.showpop = false;
  802. },
  803. //积分兑换
  804. jifenduihuan() {
  805. if (this.sumpoints > 0) {
  806. this.isjifenduihan = !this.isjifenduihan;
  807. } else {
  808. this.isjifenduihan = false;
  809. }
  810. },
  811. jisuandikou(dingdanjiner) {
  812. var sumkyjine = this.sumpoints * this.pointsBl;
  813. if (sumkyjine > dingdanjiner) {
  814. var jifen = dingdanjiner / this.pointsBl;
  815. jifen = parseInt(jifen);
  816. this.points = jifen;
  817. this.pointsReduction = jifen * this.pointsBl;
  818. } else {
  819. this.points = this.sumpoints;
  820. this.pointsReduction = sumkyjine;
  821. }
  822. return this.pointsReduction;
  823. },
  824. //商品数量加减
  825. jiajian(index, state) {
  826. if (this.actType > 0) {
  827. return;
  828. }
  829. var tempList = this.foodlist;
  830. if (state > 0) {
  831. var temp = tempList[index];
  832. temp.number = temp.number + 1;
  833. tempList[index] = temp;
  834. this.gengxingouwuche(temp);
  835. } else {
  836. var temp = tempList[index];
  837. if (temp.number > 1) {
  838. temp.number = temp.number - 1;
  839. tempList[index] = temp;
  840. } else {
  841. temp.number = temp.number - 1;
  842. tempList.splice(index, 1);
  843. }
  844. this.gengxingouwuche(temp);
  845. }
  846. this.foodlist = tempList;
  847. this.cuxiaoList();
  848. if (this.foodlist.length == 0) {
  849. uni.showToast({
  850. title: that.$t('comp.qingxzsp'),
  851. icon: 'none',
  852. duration: 2500
  853. })
  854. }
  855. },
  856. xuanzcux() {
  857. this.showpop = true;
  858. },
  859. chooseCancel() {
  860. this.showpop = false;
  861. this.zffsS = false;
  862. console.log('chooseCancel');
  863. },
  864. //--------------------------------------------------------
  865. arraytoStr(arry) {
  866. var str = '';
  867. if (arry.length > 0) {
  868. for (var i = 0; i < arry.length; i++) {
  869. str = str + arry[i] + '; ';
  870. }
  871. }
  872. return str;
  873. },
  874. jisuanjiner() {
  875. this.spxj = 0;
  876. this.hyyh = 0;
  877. this.zje = 0;
  878. for (var i = 0; i < this.foodlist.length; i++) {
  879. this.spxj = this.spxj + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i]
  880. .number;
  881. }
  882. this.hyyh = this.jisuanyouhuijiner(this.spxj);
  883. this.hyyh = parseInt(this.hyyh);
  884. this.zje = (this.spxj + this.psf) - this.hyyh;
  885. this.zje = parseInt(this.zje);
  886. //开始积分抵扣
  887. this.jisuandikou(this.zje)
  888. this.zje = this.zje - this.pointsReduction;
  889. this.zje = parseInt(this.zje);
  890. //
  891. },
  892. jisuanyouhuijiner(price) {
  893. var zongyouhui = 0;
  894. this.salesReduction = 0;
  895. this.mdSalesReduction = 0;
  896. this.discountAmount = 0;
  897. this.mdDiscountAmount = 0;
  898. if (this.cxList.length > 0) {
  899. for (var i = 0; i < this.cxList.length; i++) {
  900. var obj = this.cxList[i];
  901. console.log('111111', this.hdidpt, obj)
  902. if (obj.id == this.hdidpt) {
  903. console.log('111111', this.hdidpt, obj)
  904. if (obj.salesType == "1") {
  905. if (obj.salesReduction < 1) {
  906. this.salesReduction = this.psf * (100 - obj.salesReduction * 100) / 100;
  907. } else if (obj.salesReduction > 1) {
  908. if (obj.salesReduction > this.psf) {
  909. this.salesReduction = this.psf;
  910. } else {
  911. this.salesReduction = obj.salesReduction;
  912. }
  913. }
  914. }
  915. if (obj.salesType == "2") {
  916. if (obj.salesReduction < 1) {
  917. this.salesReduction = this.salesReduction + (price + this.psf) * (100 - obj
  918. .salesReduction * 100) / 100;
  919. } else if (obj.salesReduction > 1) {
  920. if (obj.salesReduction > (price + this.psf)) {
  921. this.salesReduction = (price + this.psf);
  922. } else {
  923. this.salesReduction = obj.salesReduction;
  924. }
  925. }
  926. console.log(price, obj.salesReduction, price * (1 - obj.salesReduction))
  927. }
  928. if (obj.salesType == "3") {
  929. if (obj.salesReduction < 1) {
  930. this.salesReduction = this.salesReduction + price * (100 - obj.salesReduction * 100) /
  931. 100;
  932. } else if (obj.salesReduction > 1) {
  933. if (obj.salesReduction > price) {
  934. this.salesReduction = price;
  935. } else {
  936. this.salesReduction = obj.salesReduction;
  937. }
  938. }
  939. }
  940. }
  941. if (obj.id == this.hdidsj) {
  942. console.log('1111112', this.hdidsj, obj)
  943. if (obj.salesType == "1") {
  944. this.mdSalesReduction = this.mdSalesReduction + this.psf;
  945. if (obj.salesReduction < 1) {
  946. this.mdSalesReduction = this.psf * (100 - obj.salesReduction * 100) / 100;
  947. } else if (obj.salesReduction > 1) {
  948. if (obj.salesReduction > this.psf) {
  949. this.mdSalesReduction = this.psf;
  950. } else {
  951. this.mdSalesReduction = obj.salesReduction;
  952. }
  953. }
  954. }
  955. if (obj.salesType == "2") {
  956. if (obj.salesReduction < 1) {
  957. this.mdSalesReduction = this.mdSalesReduction + (price + this.psf) * (100 - obj
  958. .salesReduction * 100) / 100;
  959. } else if (obj.salesReduction > 1) {
  960. if (obj.salesReduction > (price + this.psf)) {
  961. this.mdSalesReduction = (price + this.psf);
  962. } else {
  963. this.mdSalesReduction = obj.salesReduction;
  964. }
  965. }
  966. }
  967. if (obj.salesType == "3") {
  968. if (obj.salesReduction < 1) {
  969. this.mdSalesReduction = this.mdSalesReduction + price * (100 - obj.salesReduction *
  970. 100) / 100;
  971. } else if (obj.salesReduction > 1) {
  972. if (obj.salesReduction > price) {
  973. this.mdSalesReduction = price;
  974. } else {
  975. this.mdSalesReduction = obj.salesReduction;
  976. }
  977. }
  978. }
  979. }
  980. }
  981. }
  982. if (this.kqList.length > 0) {
  983. for (var i = 0; i < this.kqList.length; i++) {
  984. var obj = this.kqList[i];
  985. if (obj.id == this.kqidpt) {
  986. console.log('1111113', this.kqidpt, obj)
  987. if (obj.yhfangs == 1) {
  988. if (obj.yhnum < 1) {
  989. this.discountAmount = this.psf * (100 - obj.yhnum * 100) / 100;
  990. } else if (obj.yhnum > 1) {
  991. if (obj.yhnum > this.psf) {
  992. this.discountAmount = this.psf;
  993. } else {
  994. this.discountAmount = obj.yhnum;
  995. }
  996. }
  997. }
  998. if (obj.yhfangs == 2) {
  999. if (obj.yhnum < 1) {
  1000. this.discountAmount = (price + this.psf) * (100 - obj.yhnum * 100) / 100;
  1001. } else if (obj.yhnum > 1) {
  1002. if (obj.yhnum > (price + this.psf)) {
  1003. this.discountAmount = (price + this.psf);
  1004. } else {
  1005. this.discountAmount = obj.yhnum;
  1006. }
  1007. }
  1008. console.log(price, obj.yhnum, price * (1 - obj.yhnum))
  1009. }
  1010. if (obj.yhfangs == 3) {
  1011. if (obj.yhnum < 1) {
  1012. this.discountAmount = price * (100 - obj.yhnum * 100) / 100;
  1013. } else if (obj.yhnum > 1) {
  1014. if (obj.yhnum > price) {
  1015. this.discountAmount = price;
  1016. } else {
  1017. this.discountAmount = obj.yhnum;
  1018. }
  1019. }
  1020. }
  1021. }
  1022. if (obj.id == this.kqidsj) {
  1023. console.log('1111114', this.kqidsj, obj)
  1024. if (obj.yhfangs == 1) {
  1025. if (obj.yhnum < 1) {
  1026. this.mdDiscountAmount = this.psf * (100 - obj.yhnum * 100) / 100;
  1027. } else if (obj.yhnum > 1) {
  1028. if (obj.yhnum > this.psf) {
  1029. this.mdDiscountAmount = this.psf;
  1030. } else {
  1031. this.mdDiscountAmount = obj.yhnum;
  1032. }
  1033. }
  1034. }
  1035. if (obj.yhfangs == 2) { //订单
  1036. if (obj.yhnum > 1) {
  1037. if (obj.yhnum > (price + this.psf)) {
  1038. this.mdDiscountAmount = (price + this.psf);
  1039. } else {
  1040. this.mdDiscountAmount = obj.yhnum;
  1041. }
  1042. } else {
  1043. this.mdDiscountAmount = this.mdDiscountAmount + (price + this.psf) * (100 - obj.yhnum *
  1044. 100) / 100;
  1045. }
  1046. console.log(price, obj.yhnum, price * (1 - obj.yhnum))
  1047. }
  1048. if (obj.yhfangs == 3) { //商品
  1049. if (obj.yhnum > 1) {
  1050. if (obj.yhnum > price) {
  1051. this.mdDiscountAmount = price;
  1052. } else {
  1053. this.mdDiscountAmount = obj.yhnum;
  1054. }
  1055. } else {
  1056. this.mdDiscountAmount = this.mdDiscountAmount + price * (100 - obj.yhnum * 100) / 100;
  1057. }
  1058. console.log(price, obj.yhnum, price * (1 - obj.yhnum))
  1059. }
  1060. }
  1061. }
  1062. }
  1063. console.log(this.hdidpt, this.hdidsj, this.kqidpt, this.kqidsj)
  1064. console.log(this.salesReduction, this.mdSalesReduction, this.discountAmount, this.mdDiscountAmount)
  1065. zongyouhui = this.salesReduction + this.mdSalesReduction + this.discountAmount + this.mdDiscountAmount;
  1066. console.log('zongyouhui:', zongyouhui);
  1067. return zongyouhui;
  1068. },
  1069. sumfontnum(e) {
  1070. this.remarks = e.target.value;
  1071. },
  1072. shifodaofu() {
  1073. if (this.actType > 1) {
  1074. return;
  1075. }
  1076. if (this.shifoudf == 0) {
  1077. this.shifoudf = 1;
  1078. } else {
  1079. this.shifoudf = 0;
  1080. }
  1081. if (this.actType == 1 && this.shifoudf == 1) {
  1082. this.actTitle = this.$t('index.huodaofukan');
  1083. uni.showToast({
  1084. title: this.$t('order.xuanzezhif'),
  1085. icon: 'none',
  1086. duration: 2500
  1087. })
  1088. } else if (this.actType == 1 && this.shifoudf == 0) {
  1089. this.actTitle = this.$t('order.quzhifu');
  1090. }
  1091. console.log(this.shifoudf)
  1092. },
  1093. changaddr() {
  1094. uni.navigateTo({
  1095. url: '/pages/UserCenter/dizhi/dizhilist'
  1096. })
  1097. },
  1098. yuyueshijian() {
  1099. this.$refs.chooseTime.open()
  1100. },
  1101. changeTime(e) {
  1102. //选择的时间
  1103. console.log('选择的时间', e.value);
  1104. this.delryTime = e.value;
  1105. },
  1106. deliveryclose() {
  1107. this.delryTime = '';
  1108. },
  1109. peisong() {
  1110. if (this.actType > 0) {
  1111. return;
  1112. }
  1113. this.showAdrr = 0;
  1114. this.peisongimg = '/static/images/peisongh@3x.png';
  1115. this.ziquimg = '/static/images/ziqu@3x.png';
  1116. this.tangshiimg = '/static/images/tangshih.png';
  1117. this.Bcolor = 'whitesmoke';
  1118. this.Bcolorr = 'lightgray';
  1119. this.Bcolorrr = 'lightgray';
  1120. this.Tcolor = 'black';
  1121. this.Tcolorr = 'darkgray';
  1122. this.Tcolorrr = 'darkgray';
  1123. this.psf = parseFloat(this.freight);
  1124. this.jisuanjiner();
  1125. },
  1126. ziqu() {
  1127. if (this.actType > 0) {
  1128. return;
  1129. }
  1130. this.showAdrr = 1;
  1131. this.peisongimg = '/static/images/peisong@3x.png';
  1132. this.ziquimg = '/static/images/ziquh@3x.png';
  1133. this.tangshiimg = '/static/images/tangshih.png';
  1134. this.Bcolor = 'lightgray';
  1135. this.Bcolorr = 'whitesmoke';
  1136. this.Bcolorrr = 'lightgray';
  1137. this.Tcolor = 'darkgray';
  1138. this.Tcolorr = 'black';
  1139. this.Tcolorrr = 'darkgray';
  1140. this.psf = 0;
  1141. this.jisuanjiner();
  1142. },
  1143. tangshi() {
  1144. this.showAdrr = 2;
  1145. this.peisongimg = '/static/images/peisong@3x.png';
  1146. this.ziquimg = '/static/images/ziqu@3x.png';
  1147. this.tangshiimg = '/static/images/tangshi.png';
  1148. this.Bcolor = 'lightgray';
  1149. this.Bcolorr = 'lightgray';
  1150. this.Bcolorrr = 'whitesmoke';
  1151. this.Tcolor = 'darkgray';
  1152. this.Tcolorr = 'darkgray';
  1153. this.Tcolorrr = 'black';
  1154. this.psf = 0;
  1155. this.jisuanjiner();
  1156. },
  1157. //确认订单,要求下载app
  1158. qufukuan() {
  1159. if (this.foodlist.length == 0) {
  1160. uni.showToast({
  1161. title: this.$t('comp.qingxzsp'),
  1162. icon: 'none',
  1163. duration: 2500
  1164. })
  1165. return;
  1166. }
  1167. api('getAppDownload', {}, r => {
  1168. console.log(r)
  1169. uni.showModal({
  1170. title: this.$t('api.message'),
  1171. content: this.$t('jiesuan.xiazapp'),
  1172. showCancel: true,
  1173. cancelText: this.$t('jiesuan.xzios'),
  1174. confirmText: this.$t('jiesuan.xiazandriod'),
  1175. success: (res) => {
  1176. if (res.confirm) {
  1177. // 点击下载Android版本
  1178. const isAndroid = this.isAndroidDevice();
  1179. if (isAndroid) {
  1180. // 安卓设备自动下载并安装
  1181. this.downloadAndInstallAndroid(r.data.data.androidUrl);
  1182. } else {
  1183. // 非安卓设备直接打开下载链接
  1184. window.open(r.data.data.androidUrl, '_blank');
  1185. }
  1186. } else if (res.cancel) {
  1187. // 点击下载iOS版本
  1188. this.downloadIOSApp(r.data.data.iosUrl);
  1189. }
  1190. }
  1191. });
  1192. return;
  1193. });
  1194. return
  1195. if (this.keyixd == false) {
  1196. uni.showToast({
  1197. title: this.$t('mend.dianjiastatedy'),
  1198. icon: 'none',
  1199. duration: 2500
  1200. })
  1201. return;
  1202. }
  1203. if (this.actType == 2) { //已经支付过了!!
  1204. // uni.showToast({
  1205. // title: '已经支付过了!!',
  1206. // icon: 'none',
  1207. // duration: 2500
  1208. // })
  1209. return;
  1210. }
  1211. if (this.actType == 1) { //未支付,跳转支付
  1212. this.zffsS = true;
  1213. return;
  1214. }
  1215. var data;
  1216. if (this.ddId.length > 0) {
  1217. console.log('已经生成订单,不能重复提交');
  1218. } else {
  1219. this.ddId = '99' + new Date().valueOf();
  1220. }
  1221. var cretim = getApp().globalData.sj();
  1222. // console.log(cretim);
  1223. // return;
  1224. if (this.showAdrr == 0) {
  1225. if (this.dizhiID == '') {
  1226. uni.showToast({
  1227. title: this.$t('order.shdz'),
  1228. icon: 'none',
  1229. duration: 3500
  1230. })
  1231. return;
  1232. }
  1233. if (!this.isGetyunfei) {
  1234. uni.showToast({
  1235. title: this.$t('order.hqyfsb'),
  1236. icon: 'none',
  1237. duration: 3500
  1238. })
  1239. return;
  1240. }
  1241. data = {
  1242. "ddId": this.ddId,
  1243. "shId": this.userid,
  1244. "mdId": this.mendid,
  1245. "shdzId": this.dizhiID.id,
  1246. "amount": this.zje,
  1247. "remarks": this.remarks,
  1248. "type": 0,
  1249. "delryTime": this.delryTime, //new Date().toISOString(),
  1250. "foodlist": this.foodlist,
  1251. "freight": this.psf,
  1252. "jvli": this.jvli,
  1253. "longitude": this.mendianMs.longitude,
  1254. "latitude": this.mendianMs.latitude,
  1255. "collectPayment": this.shifoudf,
  1256. "cretim": cretim,
  1257. "yhId": this.kqidpt, //平台使用优惠券id
  1258. "mdYhId": this.kqidsj, //门店优惠券id
  1259. "activity": this.hdidpt, //平台促销活动id
  1260. "mdActivity": this.hdidsj, //门店促销活动id
  1261. "salesReduction": this.salesReduction, //平台促销減免值
  1262. "mdSalesReduction": this.mdSalesReduction, //门店促销減免值
  1263. "discountAmount": this.discountAmount, //平台优惠券优惠金额
  1264. "mdDiscountAmount": this.mdDiscountAmount, //门店优惠券优惠金额
  1265. "xiadanjiaoyan": 2
  1266. }
  1267. } else {
  1268. data = {
  1269. "ddId": this.ddId,
  1270. "shId": this.userid,
  1271. "mdId": this.mendid,
  1272. "shdzId": '',
  1273. "amount": this.zje,
  1274. "remarks": this.remarks,
  1275. "type": this.showAdrr,
  1276. "delryTime": this.delryTime, // new Date().toISOString(),
  1277. "foodlist": this.foodlist,
  1278. "freight": this.psf,
  1279. "jvli": this.jvli,
  1280. "longitude": this.mendianMs.longitude,
  1281. "latitude": this.mendianMs.latitude,
  1282. "collectPayment": this.shifoudf,
  1283. "cretim": cretim,
  1284. "yhId": this.kqidpt, //平台使用优惠券id
  1285. "mdYhId": this.kqidsj, //门店优惠券id
  1286. "activity": this.hdidpt, //平台促销活动id
  1287. "mdActivity": this.hdidsj, //门店促销活动id
  1288. "salesReduction": this.salesReduction, //平台促销減免值
  1289. "mdSalesReduction": this.mdSalesReduction, //门店促销減免值
  1290. "discountAmount": this.discountAmount, //平台优惠券优惠金额
  1291. "mdDiscountAmount": this.mdDiscountAmount, //门店优惠券优惠金额
  1292. "xiadanjiaoyan": 2
  1293. }
  1294. }
  1295. this.zhifuUrl = '';
  1296. this.addorder(data);
  1297. },
  1298. getaddressList() {
  1299. api('getaddressList', {}, r => {
  1300. this.addrList = r.data.data;
  1301. if (this.dizhiID != '') {
  1302. console.log('3333')
  1303. this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
  1304. } else {
  1305. if (this.addrList.length > 0) {
  1306. console.log('2222')
  1307. this.dizhiID = this.addrList[0];
  1308. this.mpImage = this.dizhiID.annexes;
  1309. this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
  1310. }
  1311. }
  1312. }, failc => {
  1313. //console.log('getadvertis----',failc)
  1314. })
  1315. },
  1316. getmendianDetail(id) {
  1317. api('getmendianDetail', {
  1318. id: id
  1319. }, r => {
  1320. this.mendianMs = r.data.data;
  1321. console.log('getmendianDetail', this.mendianMs);
  1322. if (this.mendianMs) {
  1323. if (this.mendianMs.state == 1) {
  1324. this.keyixd = false;
  1325. }
  1326. }
  1327. if (this.dizhiID == '') {
  1328. this.getaddressList();
  1329. } else {
  1330. console.log('111')
  1331. this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
  1332. }
  1333. }, failc => {
  1334. //console.log('getadvertis----',failc)
  1335. })
  1336. },
  1337. getyunfei(lat, lng) {
  1338. if (this.mendianMs == '') {
  1339. return;
  1340. }
  1341. //this.getjuliForyunfei(lat,lng);//前端请求规划路径
  1342. //this.getjuliForyunfeiHT(lat,lng);//后端请求规划路径
  1343. //先请求直线距离运费,如果规划路径运费小于直线距离则用直线距离的值
  1344. //1--------在这个方法中调用规划计算
  1345. console.log("getyunfei----------")
  1346. this.zhixianyuanfei(lat, lng);
  1347. },
  1348. //通过坐标直线计算运费
  1349. zhixianyuanfei(lat, lng) {
  1350. var that = this;
  1351. api('getyunfei', {
  1352. lat1: lng,
  1353. lng1: lat,
  1354. lat2: this.mendianMs.longitude,
  1355. lng2: this.mendianMs.latitude
  1356. }, r => {
  1357. console.log('直线运费');
  1358. console.log(r);
  1359. if (r.data.code != 200) {
  1360. return;
  1361. }
  1362. that.freight = parseInt(r.data.data.freight);
  1363. if (that.freight > 0) {} else {
  1364. that.freight = 0;
  1365. }
  1366. that.zhixianfreight = that.freight;
  1367. that.zhixianjuli = r.data.data.jvli;
  1368. that.getjuliForyunfeiHT(lat, lng);
  1369. }, failc => {
  1370. //console.log('getadvertis----',failc)
  1371. })
  1372. },
  1373. getjuliForyunfei(lat, lng) { //前端
  1374. var data = {
  1375. "origin": {
  1376. "location": {
  1377. "latLng": {
  1378. "latitude": lat,
  1379. "longitude": lng
  1380. }
  1381. }
  1382. },
  1383. "destination": {
  1384. "location": {
  1385. "latLng": {
  1386. "latitude": this.mendianMs.latitude,
  1387. "longitude": this.mendianMs.longitude
  1388. }
  1389. }
  1390. },
  1391. "travelMode": "DRIVE",
  1392. "units": "METRIC" //米
  1393. };
  1394. console.log(data);
  1395. api('getdistense', data, r => {
  1396. console.log('getadvertis----', r);
  1397. if (r.statusCode == 200) {
  1398. var dist = r.data.routes[0].distanceMeters;
  1399. console.log(dist / 1000);
  1400. this.getyunfeiWithJuli(dist / 1000);
  1401. console.log('路径运费');
  1402. } else {
  1403. this.zhixianyuanfei(lat, lng);
  1404. console.log('路径计算距离失败!');
  1405. uni.showToast({
  1406. title: '计算距离失败!',
  1407. icon: 'none',
  1408. duration: 3500
  1409. })
  1410. }
  1411. }, failc => {
  1412. console.log('getadvertis----', failc)
  1413. })
  1414. },
  1415. getjuliForyunfeiHT(lat, lng) {
  1416. var that = this;
  1417. var latlng1 = '' + lat + ',' + lng;
  1418. var latlng2 = '' + this.mendianMs.latitude + ',' + this.mendianMs.longitude;
  1419. // var latlng1='10.715641,106.73932';//''+lat+','+lng;
  1420. // var latlng2='10.754999,106.735601';//''+this.mendianMs.latitude+','+this.mendianMs.longitude;
  1421. api('getluxianjvli', {
  1422. latlng1: latlng1,
  1423. latlng2: latlng2,
  1424. id: this.userid
  1425. }, r => {
  1426. console.log('getjuliForyunfeiHT', r);
  1427. if (r.data.code == 200) {
  1428. if (r.data.data[0]) {
  1429. var legs = r.data.data[0].legs;
  1430. if (legs[0]) {
  1431. var juli = legs[0].distance.value;
  1432. // uni.showToast({
  1433. // title:'通过轨迹计算运费',
  1434. // icon: 'none',
  1435. // duration: 3500
  1436. // })
  1437. if (juli > that.zhixianjuli) {
  1438. that.getyunfeiWithJuli(juli / 1000);
  1439. } else {
  1440. that.psf = that.freight;
  1441. that.jvli = that.zhixianjuli;
  1442. that.isGetyunfei = true;
  1443. console.log('直线运费');
  1444. if (this.showAdrr == 0) {
  1445. that.jisuanjiner();
  1446. }
  1447. }
  1448. return;
  1449. }
  1450. }
  1451. }
  1452. that.psf = that.freight;
  1453. that.jvli = that.zhixianjuli;
  1454. that.isGetyunfei = true;
  1455. console.log('直线运费');
  1456. if (this.showAdrr == 0) {
  1457. that.jisuanjiner();
  1458. }
  1459. }, failc => {
  1460. //console.log('getadvertis----',failc)
  1461. })
  1462. },
  1463. getyunfeiWithJuli(distence) {
  1464. var that = this;
  1465. api('getZuiyyfei', {
  1466. quli: JSON.stringify(distence)
  1467. }, r => {
  1468. console.log(r);
  1469. if (r.data.code != 200) {
  1470. return;
  1471. }
  1472. that.psf = parseInt(r.data.data.freight);
  1473. if (that.psf > 0) {} else {
  1474. that.psf = 0;
  1475. }
  1476. that.freight = that.psf;
  1477. that.jvli = r.data.data.jvli;
  1478. that.isGetyunfei = true;
  1479. if (this.showAdrr == 0) {
  1480. that.jisuanjiner();
  1481. }
  1482. }, failc => {
  1483. //console.log('getadvertis----',failc)
  1484. })
  1485. },
  1486. addorder(data) {
  1487. var that = this;
  1488. uni.showLoading({
  1489. title: 'Loading...',
  1490. mask: true
  1491. })
  1492. console.log('addorder', data);
  1493. api('addorder', data,
  1494. r => {
  1495. console.log(r);
  1496. uni.hideLoading();
  1497. if (r.data.code == 200) {
  1498. this.qingkonggouwuche();
  1499. this.ddId = data.ddId;
  1500. this.rId = r.data.data.id;
  1501. this.orderDetl = r.data.data;
  1502. if (this.shifoudf == 0) {
  1503. this.actType = 1;
  1504. this.actTitle = that.$t('order.quzhifu');
  1505. uni.showToast({
  1506. title: that.$t('order.xuanzezhif'),
  1507. icon: 'none',
  1508. duration: 2500
  1509. })
  1510. } else {
  1511. this.actType = 1;
  1512. this.actTitle = that.$t('index.huodaofukan');
  1513. //到付订单,直接更新支付状态
  1514. this.huodaofukuan();
  1515. }
  1516. } else {
  1517. uni.showToast({
  1518. title: r.data.msg,
  1519. icon: 'none',
  1520. duration: 3000
  1521. })
  1522. }
  1523. }, failc => {
  1524. uni.hideLoading();
  1525. //console.log('getadvertis----',failc)
  1526. })
  1527. },
  1528. getVNPay() {
  1529. api('setorderuzt', {
  1530. id: this.rId,
  1531. "collectPayment": 0
  1532. }, res => {
  1533. if (res.data.code != 200) {
  1534. return;
  1535. }
  1536. }, failc => {
  1537. return;
  1538. })
  1539. this.zffsS = false;
  1540. var language = uni.getStorageSync('language');
  1541. var lg;
  1542. if (language == 'yuenan') {
  1543. lg = 'vi';
  1544. } else {
  1545. lg = 'en';
  1546. }
  1547. uni.showLoading({
  1548. title: 'Loading...',
  1549. mask: true
  1550. })
  1551. api('VNPay', {
  1552. orderid: this.ddId,
  1553. amount: parseInt(this.zje),
  1554. language: lg
  1555. }, r => {
  1556. uni.hideLoading();
  1557. if (r.data.code != 200) {
  1558. uni.showToast({
  1559. title: r.data.msg,
  1560. icon: 'none',
  1561. duration: 3500
  1562. })
  1563. return;
  1564. }
  1565. this.shifouzhifu = true;
  1566. this.zhifuUrl = '/pages/OrderList/buy/Zhifuyemian?url=' + encodeURIComponent(JSON.stringify(r
  1567. .data.data)) + '&ddid=' + this.ddId;
  1568. uni.navigateTo({
  1569. url: '/pages/OrderList/buy/Zhifuyemian?url=' + encodeURIComponent(JSON.stringify(r
  1570. .data.data)) + '&ddid=' + this.ddId
  1571. })
  1572. }, failc => {
  1573. uni.hideLoading();
  1574. //console.log('getadvertis----',failc)
  1575. })
  1576. },
  1577. huodaofukuan() {
  1578. this.shifoudf = 1;
  1579. this.zffsS = false;
  1580. uni.showLoading({
  1581. title: 'Loading...',
  1582. mask: true
  1583. })
  1584. var that = this;
  1585. api('setorderuzt', {
  1586. id: this.rId,
  1587. "collectPayment": this.shifoudf
  1588. }, res => {
  1589. console.log('setorderuzt:', res)
  1590. uni.hideLoading();
  1591. if (res.data.code == 200) {
  1592. this.actType = 2;
  1593. this.actTitle = that.$t('order.yizhifu');
  1594. uni.showToast({
  1595. title: that.$t('order.xiadancg'),
  1596. icon: 'none',
  1597. duration: 2500,
  1598. mask: true
  1599. })
  1600. setTimeout(function() {
  1601. // 这里写要延时执行的代码
  1602. uni.redirectTo({
  1603. url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId +
  1604. '&isShangjia=0'
  1605. })
  1606. }, 2500);
  1607. } else {
  1608. if (res.data.msg) {
  1609. uni.showToast({
  1610. title: res.data.msg,
  1611. icon: 'none',
  1612. duration: 2000
  1613. })
  1614. }
  1615. }
  1616. }, failc => {
  1617. uni.hideLoading();
  1618. //console.log('getadvertis----',failc)
  1619. })
  1620. },
  1621. setorderuzt() {
  1622. var that = this;
  1623. api('setorderuzt', {
  1624. id: this.rId,
  1625. state: 1
  1626. }, res => {
  1627. this.actType = 2;
  1628. this.actTitle = that.$t('order.yizhifu');
  1629. uni.showToast({
  1630. title: that.$t('order.xiadancg'),
  1631. icon: 'none',
  1632. duration: 2500,
  1633. mask: true
  1634. })
  1635. setTimeout(function() {
  1636. // 这里写要延时执行的代码
  1637. uni.redirectTo({
  1638. url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId + '&isShangjia=0'
  1639. })
  1640. }, 2500);
  1641. }, failc => {
  1642. //console.log('getadvertis----',failc)
  1643. })
  1644. },
  1645. getorderDetl() {
  1646. var that = this;
  1647. api('getorderxq', {
  1648. ddid: this.ddId
  1649. }, r => {
  1650. this.orderDetl = r.data.data;
  1651. if (this.orderDetl.state == 1) {
  1652. that.actType = 2;
  1653. that.actTitle = that.$t('order.yizhifu');
  1654. uni.showToast({
  1655. title: that.$t('order.xiadancg'),
  1656. icon: 'none',
  1657. duration: 2500,
  1658. mask: true
  1659. })
  1660. setTimeout(function() {
  1661. // 这里写要延时执行的代码
  1662. uni.redirectTo({
  1663. url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId +
  1664. '&isShangjia=0'
  1665. })
  1666. }, 2500);
  1667. }
  1668. }, failc => {
  1669. //console.log('getadvertis----',failc)
  1670. })
  1671. },
  1672. qingkonggouwuche() {
  1673. if (this.foodlist.length > 1) {
  1674. uni.setStorageSync('gouwuche', '');
  1675. return;
  1676. }
  1677. var gwc = uni.getStorageSync('gouwuche');
  1678. var gouwuche;
  1679. if ('' == gwc || null == gwc || undefined == gwc) {} else {
  1680. gouwuche = JSON.parse(gwc);
  1681. if (gouwuche.foodlist.length <= 1) {
  1682. uni.setStorageSync('gouwuche', '');
  1683. return;
  1684. }
  1685. for (var i = 0; i < gouwuche.foodlist.length; i++) {
  1686. var sp = gouwuche.foodlist[i];
  1687. if (this.foodlist[0].id == sp.id) {
  1688. gouwuche.foodlist.splice(i, 1);
  1689. let gwcS = JSON.stringify(gouwuche);
  1690. uni.setStorageSync('gouwuche', gwcS);
  1691. }
  1692. }
  1693. }
  1694. },
  1695. gengxingouwuche(item) {
  1696. var gwc = uni.getStorageSync('gouwuche');
  1697. if ('' == gwc || null == gwc || undefined == gwc) {
  1698. return;
  1699. }
  1700. var gouwuche = JSON.parse(gwc);
  1701. for (var i = 0; i < gouwuche.foodlist.length; i++) {
  1702. var sp = gouwuche.foodlist[i];
  1703. if (item.id == sp.id) {
  1704. if (item.number > 0) {
  1705. gouwuche.foodlist[i].number = item.number;
  1706. } else {
  1707. gouwuche.foodlist.splice(i, 1);
  1708. }
  1709. if (gouwuche.foodlist.length < 1) {
  1710. uni.setStorageSync('gouwuche', '');
  1711. } else {
  1712. let gwcS = JSON.stringify(gouwuche);
  1713. uni.setStorageSync('gouwuche', gwcS);
  1714. }
  1715. return;
  1716. }
  1717. }
  1718. },
  1719. pushMsg(cid, orderId) { //消息推送
  1720. api('pushMsgSJ', {
  1721. cid: cid,
  1722. title: '您有新订单了',
  1723. content: orderId,
  1724. payload: ''
  1725. }, res => {
  1726. console.log(res)
  1727. }, failc => {
  1728. //console.log('getadvertis----',failc)
  1729. })
  1730. },
  1731. selectImage() {
  1732. console.log('selectImage');
  1733. this.$refs.yhdslCropper.chooseImage();
  1734. },
  1735. uploadImg(e) {
  1736. console.log('------------uploadImg:', e)
  1737. this.spImage = e;
  1738. var that = this;
  1739. uni.uploadFile({
  1740. url: this.$upImagurl, //上传图片api
  1741. filePath: e,
  1742. name: 'file',
  1743. header: {
  1744. //"Authorization": userinfo.token
  1745. },
  1746. success: (res) => {
  1747. let group = JSON.parse(res.data);
  1748. that.mpImage = group.data;
  1749. console.log(group)
  1750. api('ADDaddress', {
  1751. id: that.dizhiID.id,
  1752. annexes: that.mpImage
  1753. },
  1754. res => {
  1755. if (res.data.code == 200) {
  1756. that.dizhiID.annexes = that.mpImage;
  1757. uni.setStorageSync("peisongdizhi", that.dizhiID);
  1758. }
  1759. console.log('getGoodsDetail:', res);
  1760. }, failc => {
  1761. //console.log('getadvertis----',failc)
  1762. })
  1763. uni.showToast({
  1764. title: that.$t('mend.shangccg'),
  1765. icon: "success"
  1766. })
  1767. }
  1768. });
  1769. },
  1770. }
  1771. }
  1772. </script>
  1773. <style lang="scss">
  1774. page {
  1775. background-color: #F2F3F7;
  1776. }
  1777. .contentV {
  1778. width: 100%;
  1779. position: relative;
  1780. }
  1781. .linesp {
  1782. width: 100%;
  1783. height: 8rpx;
  1784. background-color: aliceblue;
  1785. }
  1786. .pinglun {
  1787. margin: 16rpx;
  1788. padding: 10rpx;
  1789. width: 92%;
  1790. height: 100rpx;
  1791. border-radius: 15rpx;
  1792. border: 2rpx solid lightgray;
  1793. }
  1794. .ctinrow {
  1795. margin-top: 20rpx;
  1796. width: 100%;
  1797. height: 80rpx;
  1798. display: flex;
  1799. flex-direction: row;
  1800. align-items: center;
  1801. justify-content: center;
  1802. }
  1803. .delbtct {
  1804. margin-left: 10%;
  1805. margin-top: 20rpx;
  1806. padding-bottom: 30rpx;
  1807. width: 80%;
  1808. }
  1809. .delbt {
  1810. text-align: center;
  1811. font-size: 36rpx;
  1812. width: 100%;
  1813. height: 80rpx;
  1814. line-height: 80rpx;
  1815. color: white;
  1816. background-color: goldenrod;
  1817. border-radius: 10rpx;
  1818. }
  1819. .topSwichV {
  1820. height: 70rpx;
  1821. width: 280rpx;
  1822. border-radius: 35rpx;
  1823. display: flex;
  1824. flex-direction: row;
  1825. align-items: center;
  1826. justify-content: center;
  1827. }
  1828. .topSwichVL {
  1829. margin-left: -40rpx;
  1830. height: 70rpx;
  1831. width: 200rpx;
  1832. border-radius: 35rpx;
  1833. display: flex;
  1834. flex-direction: row;
  1835. align-items: center;
  1836. justify-content: center;
  1837. }
  1838. .toppz {
  1839. width: 50rpx;
  1840. }
  1841. .toppztext {
  1842. font-size: 30rpx;
  1843. }
  1844. .spnodetail {
  1845. display: flex;
  1846. flex-direction: row;
  1847. align-items: center;
  1848. background-color: white;
  1849. margin-top: 20rpx;
  1850. margin-bottom: 20rpx;
  1851. }
  1852. .spIcon {
  1853. margin: 20rpx;
  1854. width: 90rpx;
  1855. height: 90rpx;
  1856. }
  1857. .xiaoji {
  1858. margin-left: auto;
  1859. margin-right: 30rpx;
  1860. }
  1861. .actBTV {
  1862. width: 100%;
  1863. display: flex;
  1864. flex-direction: row;
  1865. justify-content: space-between;
  1866. align-items: center;
  1867. }
  1868. .viewinrow {
  1869. display: flex;
  1870. flex-direction: row;
  1871. align-items: center;
  1872. width: 100%;
  1873. }
  1874. .kouweisku {
  1875. padding-right: 10rpx;
  1876. color: chocolate;
  1877. font-size: 26rpx;
  1878. }
  1879. .shifdf {
  1880. height: 90rpx;
  1881. width: 90%;
  1882. margin-left: 5%;
  1883. align-items: center;
  1884. }
  1885. .shifdftext {
  1886. margin-left: 30rpx;
  1887. font-size: 30rpx;
  1888. }
  1889. .hdts {
  1890. margin-left: 30rpx;
  1891. font-size: 30rpx;
  1892. overflow: hidden;
  1893. text-overflow: ellipsis;
  1894. display: -webkit-box;
  1895. -webkit-line-clamp: 1;
  1896. -webkit-box-orient: vertical;
  1897. }
  1898. .picker-view {
  1899. width: 750rpx;
  1900. height: 300rpx;
  1901. margin-top: 10rpx;
  1902. }
  1903. .item {
  1904. line-height: 100rpx;
  1905. text-align: center;
  1906. }
  1907. .zhifbut {
  1908. text-align: center;
  1909. margin-top: 12rpx;
  1910. margin-bottom: 12rpx;
  1911. width: 80%;
  1912. border-radius: 10rpx;
  1913. color: white;
  1914. line-height: 70rpx;
  1915. }
  1916. .imageRJ {
  1917. width: 40rpx;
  1918. height: 40rpx;
  1919. margin-right: 8rpx;
  1920. }
  1921. .imageR {
  1922. width: 40rpx;
  1923. height: 40rpx;
  1924. margin-right: 30rpx;
  1925. }
  1926. .textR {
  1927. font-size: 26rpx;
  1928. margin-left: 6rpx;
  1929. margin-right: 6rpx;
  1930. }
  1931. </style>