| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280 |
- <template>
- <view class="contentV">
- <customNav :shownav="true" :title="$t('index.xiadanzhifu')" titledetl=""></customNav>
- <view class="ctinrow">
- <view class="topSwichV" :style="{backgroundColor:Bcolor}" @click="peisong">
- <view class="topSwichV">
- <image class="toppz" :src="peisongimg" mode="widthFix"></image>
- <text class="toppztext" :style="{color:Tcolor}">{{$t('order.peisong')}}</text>
- </view>
- </view>
- <view class="topSwichVL" :style="{backgroundColor:Bcolorr}" @click="ziqu">
- <view class="topSwichVL">
- <image class="toppz" :src="ziquimg" mode="widthFix"></image>
- <text class="toppztext" :style="{color:Tcolorr}">{{$t('order.ziqu')}}</text>
- </view>
- </view>
- <!-- <view class="topSwichVL" :style="{backgroundColor:Bcolorrr}" @click="tangshi">
- <view class="topSwichVL">
- <image class="toppz" :src="tangshiimg" mode="widthFix"></image>
- <text class="toppztext" :style="{color:Tcolorrr}">{{$t('shouye.tangshi')}}</text>
- </view>
- </view> -->
- </view>
- <label class="linesp"></label>
- <uni-list v-if="showAdrr==0">
- <uni-list-item :title="dizhiID.address" :note="dizhiID.phone" :rightText="dizhiID.name"
- thumb="/static/images/dizhil@3x.png" thumb-size="sm" @click="changaddr" link></uni-list-item>
- </uni-list>
- <uni-list>
- <uni-list-item :title="delryTime.length>0?$t('order.yuyueshijian'):$t('order.jinkuaisd')"
- :note="delryTime.length>0?delryTime:('10~20 '+$t('order.Xfenzhongsd'))"
- :rightText="$t('order.yuyueshijian')" thumb="/static/images/time@3x.png" thumb-size="sm"
- @click="yuyueshijian" link></uni-list-item>
- </uni-list>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <uni-list>
- <uni-list-item :title="$t('index.goodslist')"></uni-list-item>
- </uni-list>
- <view v-for="(item,findex) in foodlist">
- <view class="spnodetail">
- <view class="">
- <myImage class="spIcon" :mysrc="item.image" mymode="scaleToFill"></myImage>
- </view>
- <view style="width: 82%;">
- <view class="actBTV">
- <view style="font-size: 30rpx;width: 100%;">
- <text class="text2row" style="width: 100%;">{{item.name}}</text>
- </view>
- <view class="contentInRowL">
- <image v-if="item.number>0" class="imageRJ" src="/static/images/jian@3x.png"
- mode="aspectFit" @click="jiajian(findex,-1)"></image>
- <text v-if="item.number>0" class="textR">{{item.number}}</text>
- <image class="imageR" src="/static/images/plus-circle-fill@3x.png" mode="aspectFit"
- @click="jiajian(findex,1)"></image>
- </view>
- </view>
- <view class="actBTV">
- <view style="font-size: 26rpx;color: blueviolet;">{{$t('shangpin.shoujia')}}:
- {{$formPr(item.price+item.otherPrice)}}{{$t('locale.huobidw')}}
- </view>
- <view class="xiaoji" style="font-size: 28rpx;color: brown;">{{$t('shangpin.xiaoji')}}:
- {{$formPr((item.price+item.otherPrice)*item.number)}}{{$t('locale.huobidw')}}
- </view>
- </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>
- </view>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <view style="background-color:white;width: 100%;">
- <view class="contentInRowS shifdf" @click="xuanzcux">
- <view class="contentInRowL" style="width: 86%;">
- <image style="width: 50rpx;height: 50rpx;" src="/static/images/hongbkqh@3x.png" mode="scaleToFill">
- </image>
- <view class="contentColumn" style="width: 100%;">
- <text class="shifdftext"
- :style="youyh?'color:fuchsia;':'color:darkgray;'">{{$t('index.hongbaokq')}}</text>
- <text class="hdts" style="color: black;font-size: 26rpx;">{{yhhd}}</text>
- </view>
- </view>
- <image v-if="hyyh!=0" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png"
- mode="scaleToFill"></image>
- </view>
- </view>
- <!-- <view style="background-color:white;width: 100%;">
- <view class="contentInRowS shifdf" @click="jifenduihuan">
- <view class="contentInRowL" style="width: 86%;">
- <image style="width: 50rpx;height: 50rpx;" src="/static/images/hongbkqh@3x.png" mode="scaleToFill"></image>
- <view class="contentColumn" style="width: 100%;">
- <text class="shifdftext" :style="isjifenduihan?'color:green;':'color:darkgray;'">积分兑换</text>
- <text v-if="points>0" class="hdts" style="color: black;font-size: 26rpx;">{{points}}积分兑换{{pointsReduction}}</text>
- </view>
- </view>
- <image v-if="isjifenduihan" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png" mode="scaleToFill"></image>
- </view>
- </view> -->
- <view class="contentInRowS shifdf" @click="shifodaofu">
- <view class="contentInRowC">
- <image style="width: 50rpx;height: 50rpx;" src="/static/images/payflact@3x.png" mode="scaleToFill">
- </image>
- <text class="shifdftext"
- :style="shifoudf==0?'color:darkgray;':'color:fuchsia;'">{{$t('index.huodaofukan')}}</text>
- </view>
- <image v-if="shifoudf==1" style="width: 50rpx;height: 50rpx;" src="/static/images/dagoul.png"
- mode="scaleToFill"></image>
- </view>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <uni-list>
- <uni-list-item :title="$t('order.beizhu')"></uni-list-item>
- </uni-list>
- <textarea class="pinglun" :placeholder="$t('order.srddbz')" :value="remarks" @input="sumfontnum"></textarea>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <!-- <view v-if="showAdrr==0">
- <uni-list>
- <uni-list-item :title="$t('order.menpaizp')"></uni-list-item>
- </uni-list>
- <view class="contentColumnC" style="margin-top: 30rpx;" @click="selectImage">
- <netImage width="640" height="640" :mysrc="mpImage" mymode="scaleToFill"></netImage>
- </view>
- <view class="linesp" style="margin-top: 20rpx;"></view>
- <label class="linesp"></label>
- </view> -->
- <uni-list>
- <uni-list-item :title="$t('order.shangpinxj')" :rightText="$formPr(spxj)+$t('locale.huobidw')" />
- <uni-list-item :title="$t('order.peisongfei')" :rightText="$formPr(psf)+$t('locale.huobidw')" />
- <uni-list-item :title="$t('order.youhuijine')" :rightText="'-'+$formPr(hyyh)+$t('locale.huobidw')" />
- </uni-list>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <uni-list>
- <uni-list-item :title="$t('order.zhifujine')" :rightText="$formPr(zje)+$t('locale.huobidw')" />
- </uni-list>
- <label class="linesp"></label>
- <label class="linesp"></label>
- <view class="delbtct">
- <view class="delbt" @click="qufukuan">
- <label>{{actTitle}}</label>
- </view>
- </view>
- <label class="linesp"></label>
- <liu-delivery-time @change="changeTime" @close="deliveryclose" ref="chooseTime"
- :title="$t('order.yuyueshijian')"></liu-delivery-time>
- <yhdslCropper ref="yhdslCropper" :quality="1" mode="scale" @uploadImg="uploadImg" :scale="scale"></yhdslCropper>
- <popViewGG :show="showpop" :acttips="$t('order.queding')" :maskClosable="true" :isCancel="false"
- @chooseCancel="chooseCancel">
- <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
- <view class="contentColumnC" style="height: 80rpx;width: 100%;background-color: lightgray;">
- <view class="contentInRowS" style="height: 80rpx;width: 90%;">
- <text style="font-size: 30rpx;color: crimson;" @click="querenyhhd"></text>
- <text style="font-size: 28rpx;">{{$t('index.hongbaokq')}}</text>
- <text style="font-size: 30rpx;color: #00A6FF;"
- @click="querenyhhd">{{$t('order.queding')}}</text>
- </view>
- </view>
- <view v-if="cxList.length>0" style="width: 90%;">
- <checkbox-group @change="hdradioChange">
- <label class="contentColumn" style="margin-top: 16rpx;" v-for="(item, index) in cxList"
- :key="index">
- <checkbox :value="item.id" :checked="item.id === hdidpt||item.id === hdidsj">
- <view class="contentColumn" :style="item.type==0?'color: #00A6FF;':'color:green;'">
- <text style="font-size: 28rpx;">{{item.salesName}}</text>
- <text style="font-size: 28rpx;">{{getNote(item,0)}}</text>
- </view>
- </checkbox>
- </label>
- </checkbox-group>
- </view>
- <view v-if="kqList.length>0" style="width: 90%;">
- <checkbox-group @change="kaqradioChange">
- <label class="contentColumn" style="margin-top: 16rpx;" v-for="(item, index) in kqList"
- :key="index">
- <checkbox :value="item.id" :checked="item.id === kqidpt||item.id === kqidsj">
- <view class="contentColumn" :style="item.type==0?'color: #00A6FF;':'color:green;'">
- <text style="font-size: 28rpx;">{{item.name}}</text>
- <text style="font-size: 28rpx;">{{getNote(item,1)}}</text>
- </view>
- </checkbox>
- </label>
- </checkbox-group>
- </view>
- <view class="contentInRowC" style="width: 100%;height: 80rpx;margin-top: 16rpx;">
- <text>{{$t('hongbaokq.leijiyh')}} {{hyyh}}{{$t('locale.huobidw')}}</text>
- </view>
- <view style="height: 80rpx;"></view>
- </view>
- </popViewGG>
- <popViewGG :tips="$t('order.zhifufangshi')" :show="zffsS" :showbotom="false" :maskClosable="true"
- :isCancel="true" @chooseCancel="chooseCancel">
- <view class="contentColumnC" style="width: 100%;background-color: whitesmoke;">
- <view class="zhifbut" style="background-color: deeppink;" @click="huodaofukuan">
- {{$t('index.huodaofukan')}}
- </view>
- <!-- <view class="zhifbut" style="background-color:#00A6FF;" @click="getVNPay">VNPAY</view> -->
- </view>
- </popViewGG>
- </view>
- </template>
- <script>
- import uniList from '@/uni_modules/uni-list/uni-list.vue';
- import uniListItem from '@/uni_modules/uni-list-item/uni-list-item.vue';
- // import uniAd from '@/uni_modules/uni-list-ad/uni-list-ad.vue';
- // import uniChat from '@/uni_modules/uni-list-chat/uni-list-chat.vue';
- import yhdslCropper from '@/components/yhdsl-cropper/yhdsl-cropper.vue';
- import api from "@/pages/api/api.js"
- export default {
- components: {
- uniList,
- uniListItem,
- yhdslCropper
- },
- data() {
- return {
- mendid: 0,
- userid: 0,
- ddId: '',
- rId: '',
- showAdrr: 0,
- foodlist: [],
- Bcolor: 'whitesmoke',
- Bcolorr: 'lightgray',
- Bcolorrr: 'lightgray',
- Tcolor: 'black',
- Tcolorr: 'darkgray',
- Tcolorrr: 'darkgray',
- peisongimg: '/static/images/peisongh@3x.png',
- ziquimg: '/static/images/ziqu@3x.png',
- tangshiimg: '/static/images/tangshih.png',
- actTitle: this.$t('order.querendd'),
- actType: 0,
- remarks: '',
- spxj: 0.00,
- psf: 0.00,
- freight: 0.00,
- hyyh: 0.00,
- zje: 0.00,
- jvli: 0.00,
- zhixianjuli: 0.00,
- zhixianfreight: 0.00,
- dizhiID: '',
- addrList: [],
- peisongdizhiaddress: '',
- peisongdizhiname: '',
- peisongdizhiphone: '',
- zfindex: 0,
- delryTime: '',
- isGetyunfei: false,
- mendianMs: '',
- cid: '',
- orderDetl: '',
- shifouzhifu: false,
- zhifuUrl: '',
- shifoudf: 0,
- scale: 1,
- baseUrl: this.$baseImagurl,
- mpImage: '',
- showpop: false,
- indicatorStyle: 'height: 50px;',
- zffsS: false,
- keyixd: true,
- cxList: [],
- hdidpt: 0, //平台促销活动id
- hdidsj: 0, //门店促销活动id
- kqList: [],
- kqidpt: 0, //平台使用优惠券id
- kqidsj: 0, //门店优惠券id
- yhhd: '',
- youyh: false,
- discountAmount: 0, //平台优惠券优惠金额
- salesReduction: 0, //平台促销減免值
- mdDiscountAmount: 0, //门店优惠券优惠金额
- mdSalesReduction: 0, //门店促销減免值
- isjifenduihan: false,
- sumpoints: 0, //全部积分
- pointsBl: 0, //积分抵扣比例
- points: 0, //抵扣的积分
- pointsReduction: 0 //积分抵扣值
- }
- },
- onLoad(option) {
- console.log(option)
- this.foodlist = uni.getStorageSync("JSfoodlist");
- uni.setStorageSync('JSfoodlist', '');
- this.mendid = option.mendid;
- this.userid = option.userid;
- this.cid = uni.getStorageSync("cid");
- this.cuxiaoList();
- //this.getPoint();
- },
- onShow() {
- var temp = uni.getStorageSync("peisongdizhi");
- if (undefined == temp || null == temp || '' == temp) {
- this.dizhiID = '';
- //this.getaddressList();
- } else {
- this.dizhiID = temp;
- this.mpImage = this.dizhiID.annexes;
- }
- this.isGetyunfei = false;
- if (this.mendianMs == '') {
- this.getmendianDetail(this.mendid);
- } else {
- if (this.dizhiID == '') {
- this.getaddressList();
- } else {
- console.log('4444')
- this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
- }
- }
- if (this.shifouzhifu) {
- this.shifouzhifu = false;
- this.getorderDetl();
- }
- },
- methods: {
- // 检测是否为安卓设备
- isAndroidDevice() {
- // 在H5环境中检测
- // #ifdef H5
- const ua = navigator.userAgent.toLowerCase();
- return ua.indexOf('android') > -1;
- // #endif
- // 在App环境中检测
- // #ifdef APP-PLUS
- return plus.os.name === 'Android';
- // #endif
- // 其他环境默认返回false
- return false;
- },
- // 安卓设备自动下载并安装APK
- downloadAndInstallAndroid(androidUrl) {
- const that = this;
- // 先尝试打开已安装的应用
- this.tryOpenInstalledApp();
- },
- // 尝试打开已安装的应用
- tryOpenInstalledApp() {
- const that = this;
- const appSchema = 'cityexpressuser://';
- // 在App环境中使用plus.runtime.openURL
- // #ifdef APP-PLUS
- plus.runtime.openURL(appSchema, function() {
- console.log(that.$t('download.app_opened_success'));
- }, function(e) {
- console.log(that.$t('download.app_not_installed'));
- // 应用未安装,继续下载流程
- that.startDownloadProcess();
- });
- // #endif
- // 在H5环境中尝试打开应用
- // #ifdef H5
- this.tryOpenAppInH5(appSchema);
- // #endif
- },
- // 在H5环境中尝试打开应用
- tryOpenAppInH5(appSchema) {
- const that = this;
- // 检测是否为iOS设备
- const isIOS = this.isIOSDevice();
- if (isIOS) {
- // iOS设备使用特殊处理
- this.tryOpenIOSApp(appSchema);
- } else {
- // 安卓设备使用iframe方式
- this.tryOpenAndroidApp(appSchema);
- }
- },
- // 尝试打开iOS应用
- tryOpenIOSApp(appSchema) {
- const that = this;
- // 记录开始时间
- const startTime = Date.now();
- let hasApp = false;
- // 监听页面可见性变化
- const handleVisibilityChange = () => {
- if (document.hidden) {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- }
- };
- // 监听页面隐藏事件
- const handlePageHide = () => {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- };
- // 监听窗口失焦事件
- const handleBlur = () => {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- };
- // 设置超时检测
- const timeout = setTimeout(() => {
- if (!hasApp) {
- // 应用未安装,继续下载流程
- that.startDownloadProcess();
- }
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- }, 1500); // 缩短超时时间
- // 添加事件监听器
- document.addEventListener('visibilitychange', handleVisibilityChange);
- document.addEventListener('pagehide', handlePageHide);
- window.addEventListener('blur', handleBlur);
- // 尝试打开应用
- try {
- // 方法1: 直接使用window.location
- window.location.href = appSchema;
- } catch (e) {
- // 方法2: 使用iframe
- const iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- iframe.style.width = '1px';
- iframe.style.height = '1px';
- iframe.src = appSchema;
- document.body.appendChild(iframe);
- // 清理iframe
- setTimeout(() => {
- if (document.body.contains(iframe)) {
- document.body.removeChild(iframe);
- }
- }, 1000);
- }
- },
- // 尝试打开安卓应用
- tryOpenAndroidApp(appSchema) {
- const that = this;
- let hasApp = false;
- // 监听页面可见性变化
- const handleVisibilityChange = () => {
- if (document.hidden) {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- }
- };
- // 监听页面隐藏事件
- const handlePageHide = () => {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- };
- // 监听窗口失焦事件
- const handleBlur = () => {
- hasApp = true;
- clearTimeout(timeout);
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- };
- // 设置超时检测
- const timeout = setTimeout(() => {
- if (!hasApp) {
- // 应用未安装,继续下载流程
- that.startDownloadProcess();
- }
- document.removeEventListener('visibilitychange', handleVisibilityChange);
- document.removeEventListener('pagehide', handlePageHide);
- document.removeEventListener('blur', handleBlur);
- }, 1500); // 缩短超时时间
- // 添加事件监听器
- document.addEventListener('visibilitychange', handleVisibilityChange);
- document.addEventListener('pagehide', handlePageHide);
- window.addEventListener('blur', handleBlur);
- // 尝试打开应用
- try {
- // 方法1: 直接使用window.location
- window.location.href = appSchema;
- } catch (e) {
- // 方法2: 使用iframe
- const iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- iframe.style.width = '1px';
- iframe.style.height = '1px';
- iframe.src = appSchema;
- document.body.appendChild(iframe);
- // 清理iframe
- setTimeout(() => {
- if (document.body.contains(iframe)) {
- document.body.removeChild(iframe);
- }
- }, 1000);
- }
- },
- // 开始下载流程
- startDownloadProcess() {
- const that = this;
- // 显示下载提示
- uni.showLoading({
- title: this.$t('download.downloading'),
- mask: true
- });
- // 获取下载链接
- api('getAppDownload', {}, r => {
- console.log(r);
- // 检测是否为安卓设备
- const isAndroid = this.isAndroidDevice();
- if (isAndroid) {
- // 安卓设备下载APK
- that.downloadAndroidAPK(r.data.data.androidUrl);
- } else {
- // iOS设备打开App Store
- that.openAppStore(r.data.data.iosUrl);
- }
- });
- },
- // 下载安卓APK
- downloadAndroidAPK(androidUrl) {
- const that = this;
- // 在App环境中使用plus.downloader
- // #ifdef APP-PLUS
- const appDownloadTask = plus.downloader.createDownload(androidUrl, {
- filename: '_downloads/CTE.apk'
- }, function(download, status) {
- uni.hideLoading();
- if (status === 200) {
- // 下载成功,尝试安装
- that.installAndroidApp(download.filename);
- } else {
- uni.showToast({
- title: that.$t('download.download_failed'),
- icon: 'none',
- duration: 2000
- });
- }
- });
- // 监听下载进度
- appDownloadTask.addEventListener('statechanged', function(download, status) {
- if (status === 200) {
- const progress = Math.round((download.downloadedSize / download.totalSize) * 100);
- uni.showLoading({
- title: that.$t('download.downloading_progress', {
- progress: progress
- }),
- mask: true
- });
- }
- });
- appDownloadTask.start();
- // #endif
- // 在H5环境中使用uni.downloadFile
- // #ifdef H5
- const h5DownloadTask = uni.downloadFile({
- url: androidUrl,
- success: function(res) {
- uni.hideLoading();
- if (res.statusCode === 200) {
- // 下载成功,尝试安装
- that.installAndroidApp(res.tempFilePath);
- } else {
- uni.showToast({
- title: that.$t('download.download_failed'),
- icon: 'none',
- duration: 2000
- });
- }
- },
- fail: function(err) {
- uni.hideLoading();
- console.log('下载失败:', err);
- // 下载失败时,提供手动下载选项
- uni.showModal({
- title: that.$t('download.download_failed'),
- content: that.$t('download.download_failed_manual'),
- showCancel: true,
- cancelText: that.$t('comp.quxiao'),
- confirmText: that.$t('comp.queren'),
- success: function(res) {
- if (res.confirm) {
- // 使用浏览器打开下载链接
- window.open(androidUrl, '_blank');
- }
- }
- });
- }
- });
- // 监听下载进度
- h5DownloadTask.onProgressUpdate(function(res) {
- const progress = Math.round(res.progress);
- uni.showLoading({
- title: that.$t('download.downloading_progress', {
- progress: progress
- }),
- mask: true
- });
- });
- // #endif
- },
- // 打开App Store
- openAppStore(iosUrl) {
- const that = this;
- // 在App环境中使用plus.runtime.openURL
- // #ifdef APP-PLUS
- plus.runtime.openURL(
- 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188',
- (res) => {
- console.log(that.$t('download.app_store_success'))
- },
- (err) => {
- console.log(that.$t('download.app_store_failed'))
- // 如果 itms-apps:// 失败,回退到浏览器打开
- plus.runtime.openURL('https://apps.apple.com/cn/app/cte/id6468907188')
- }
- );
- // #endif
- // 在H5环境中,针对iOS设备优化
- // #ifdef H5
- // 先尝试直接打开App Store链接
- const appStoreUrl = 'https://apps.apple.com/cn/app/cte/id6468907188';
- // 尝试多种方式打开App Store
- that.tryOpenAppStore(appStoreUrl);
- // #endif
- },
- // 安装安卓应用
- installAndroidApp(filePath) {
- const that = this;
- // 在App环境中,直接尝试安装APK
- // #ifdef APP-PLUS
- uni.showModal({
- title: that.$t('download.download_complete'),
- content: that.$t('download.install_confirm'),
- showCancel: true,
- cancelText: that.$t('comp.quxiao'),
- confirmText: that.$t('comp.queren'),
- success: function(res) {
- if (res.confirm) {
- // 使用plus.runtime.install安装APK
- plus.runtime.install(filePath, {
- force: false
- }, function() {
- uni.showToast({
- title: that.$t('download.install_success'),
- icon: 'success',
- duration: 2000
- });
- }, function(e) {
- console.log('安装失败:', e);
- uni.showModal({
- title: that.$t('download.install_failed'),
- content: that.$t('download.install_failed_manual'),
- showCancel: true,
- cancelText: that.$t('comp.quxiao'),
- confirmText: that.$t('comp.queren'),
- success: function(res) {
- if (res.confirm) {
- // 打开文件管理器
- plus.runtime.openFile(filePath);
- }
- }
- });
- });
- }
- }
- });
- // #endif
- // 在H5环境中,提示用户手动安装
- // #ifdef H5
- uni.showModal({
- title: that.$t('download.download_complete'),
- content: that.$t('download.manual_install_hint'),
- showCancel: false,
- confirmText: that.$t('comp.queren'),
- success: function(res) {
- if (res.confirm) {
- // 尝试打开下载链接,让用户手动下载
- window.open(filePath, '_blank');
- }
- }
- });
- // #endif
- },
- // 下载iOS应用
- downloadIOSApp(iosUrl) {
- // 检测是否为iOS设备
- const isIOS = this.isIOSDevice();
- if (!isIOS) {
- // 非iOS设备直接打开浏览器链接
- window.open('https://apps.apple.com/cn/app/cte/id6468907188', '_blank');
- return;
- }
- // 先尝试打开已安装的应用
- this.tryOpenInstalledApp();
- },
- // 检测是否为iOS设备
- isIOSDevice() {
- // #ifdef H5
- const ua = navigator.userAgent.toLowerCase();
- return /iphone|ipad|ipod/.test(ua);
- // #endif
- // #ifdef APP-PLUS
- return plus.os.name === 'iOS';
- // #endif
- return false;
- },
- // 尝试打开App Store的多种方式
- tryOpenAppStore(appStoreUrl) {
- // 方法1: 直接使用window.open
- const newWindow = window.open(appStoreUrl, '_blank');
- // 如果新窗口被阻止,尝试其他方法
- if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
- // 方法2: 尝试使用itms-apps协议
- this.tryItmsProtocol();
- }
- },
- // 尝试使用itms-apps协议
- tryItmsProtocol() {
- const itmsUrl = 'itms-apps://itunes.apple.com/cn/app/cte/id6468907188';
- // 创建一个隐藏的iframe来尝试打开itms-apps协议
- const iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- iframe.style.width = '1px';
- iframe.style.height = '1px';
- iframe.src = itmsUrl;
- document.body.appendChild(iframe);
- // 设置超时,如果App Store没有打开,则回退到浏览器
- setTimeout(() => {
- if (document.body.contains(iframe)) {
- document.body.removeChild(iframe);
- }
- // 最后回退到浏览器打开
- window.location.href = 'https://apps.apple.com/cn/app/cte/id6468907188';
- }, 1500);
- },
- //促销
- cuxiaoList() {
- this.youyh = false;
- this.yhhd = '';
- var price = 0;
- for (var i = 0; i < this.foodlist.length; i++) {
- price = price + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i].number;
- }
- this.cxList = [];
- api('cuxiaoList', {
- mdId: this.mendid,
- price: price,
- yfPrice: this.psf
- }, r => {
- console.log(r);
- console.log('-----------1', this.mendid, price, this.psf)
- if (r.data.code == 200) {
- this.cxList = r.data.data;
- if (this.cxList.length > 0) {
- this.yhhd = this.$t('order.qingxzyhkq');
- this.youyh = true;
- }
- }
- this.jisuanjiner();
- this.kaquanList();
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- kaquanList() {
- var price = 0;
- for (var i = 0; i < this.foodlist.length; i++) {
- price = price + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i].number;
- }
- this.kqList = [];
- api('orderyhList', {
- mdId: this.mendid,
- price: price,
- yfPrice: this.psf
- }, r => {
- console.log(r);
- console.log('-----------2', this.mendid, price, this.psf)
- if (r.data.code == 200) {
- this.kqList = r.data.data;
- if (this.kqList.length > 0) {
- this.yhhd = this.$t('order.qingxzyhkq');
- this.youyh = true;
- } else {
- if (!this.youyh) {
- this.yhhd = '';
- this.youyh = false;
- }
- }
- }
- this.jisuanjiner();
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- //积分
- getPoint() {
- api('getPoint', {}, r => {
- console.log("getPoint:", r);
- if (r.data.code == 200) {
- this.sumpoints = r.data.data.points; //积分
- this.pointsBl = r.data.data.bl; //积分抵扣值
- } else if (r.data.code == 500) {
- this.sumpoints = 0; //积分
- this.pointsBl = 0; //积分抵扣值
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- hdradioChange(evt) {
- console.log(evt.detail.value)
- var hdids = evt.detail.value;
- var hdid = 0;
- var hdidpt = 0;
- var hdidsj = 0;
- for (var i = 0; i < hdids.length; i++) {
- var oid = hdids[i];
- if (oid == this.hdidpt) {
- hdidpt = oid;
- } else if (oid == this.hdidsj) {
- hdidsj = oid;
- } else {
- hdid = oid;
- }
- }
- this.hdidpt = hdidpt;
- this.hdidsj = hdidsj;
- var sobj = null;
- for (var i = 0; i < this.cxList.length; i++) {
- var obj = this.cxList[i];
- if (obj.id == hdid) {
- sobj = obj;
- break;
- }
- }
- if (this.cxList.length > 0 && hdid > 0) {
- for (var i = 0; i < this.cxList.length; i++) {
- var obj = this.cxList[i];
- if (obj.id == this.hdidpt) {
- if (sobj.salesType == obj.salesType) {
- this.hdidpt = 0;
- }
- }
- if (obj.id == this.hdidsj) {
- if (sobj.salesType == obj.salesType) {
- this.hdidsj = 0;
- }
- }
- }
- }
- if (this.kqList.length > 0 && hdid > 0) {
- for (var i = 0; i < this.kqList.length; i++) {
- var obj = this.kqList[i];
- if (obj.id == this.kqidpt) {
- if (sobj.salesType == obj.yhfangs) {
- this.kqidpt = 0;
- }
- }
- if (obj.id == this.kqidsj) {
- if (sobj.salesType == obj.yhfangs) {
- this.kqidsj = 0;
- }
- }
- }
- }
- if (hdid > 0) {
- if (sobj && sobj.type == 0) {
- this.hdidpt = hdid;
- } else if (sobj && sobj.type == 1) {
- this.hdidsj = hdid;
- }
- }
- this.jisuanjiner();
- },
- kaqradioChange(evt) {
- console.log(evt)
- var kqids = evt.detail.value;
- var kqid = 0;
- var kqidpt = 0;
- var kqidsj = 0;
- for (var i = 0; i < kqids.length; i++) {
- var oid = kqids[i];
- if (oid == this.kqidpt) {
- kqidpt = oid;
- } else if (oid == this.kqidsj) {
- kqidsj = oid;
- } else {
- kqid = oid;
- }
- }
- this.kqidpt = kqidpt;
- this.kqidsj = kqidsj;
- var sobj = null;
- for (var i = 0; i < this.kqList.length; i++) {
- var obj = this.kqList[i]
- if (obj.id == kqid) {
- sobj = obj;
- break;
- }
- }
- if (this.cxList.length > 0 && kqid > 0) {
- for (var i = 0; i < this.cxList.length; i++) {
- var obj = this.cxList[i];
- if (obj.id == this.hdidpt) {
- if (sobj.yhfangs == obj.salesType) {
- this.hdidpt = 0;
- }
- }
- if (obj.id == this.hdidsj) {
- if (sobj.yhfangs == obj.salesType) {
- this.hdidsj = 0;
- }
- }
- }
- }
- if (this.kqList.length > 0 && kqid > 0) {
- for (var i = 0; i < this.kqList.length; i++) {
- var obj = this.kqList[i];
- if (obj.id == this.kqidpt) {
- if (sobj.yhfangs == obj.yhfangs) {
- this.kqidpt = 0;
- }
- }
- if (obj.id == this.kqidsj) {
- if (sobj.yhfangs == obj.yhfangs) {
- this.kqidsj = 0;
- }
- }
- }
- }
- if (kqid >= 0) {
- if (sobj && sobj.type == 0) {
- this.kqidpt = kqid;
- } else if (sobj && sobj.type == 1) {
- this.kqidsj = kqid;
- }
- }
- this.jisuanjiner();
- },
- getNote(obj, index) {
- var str = '';
- if (index == 0) {
- var str = '';
- if (obj.salesType == 1 && obj.salesReduction > 1) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeiyh');
- }
- if (obj.salesType == 1 && obj.salesReduction < 1 && obj.salesReduction > 0) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeizk');
- }
- if (obj.salesType == 1 && obj.salesReduction == 0) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeiquanm');
- }
- if (obj.salesType == 2 && obj.salesReduction > 1) {
- str = this.$t('hongbaokq.dingdanyh');
- }
- if (obj.salesType == 2 && obj.salesReduction < 1) {
- str = this.$t('hongbaokq.dingdanzk');
- }
- if (obj.salesType == 3 && obj.salesReduction > 1) {
- str = this.$t('hongbaokq.shangpinyh');
- }
- if (obj.salesType == 3 && obj.salesReduction < 1) {
- str = this.$t('hongbaokq.shangpinzk');
- }
- if (obj.salesReduction != 0) {
- str = str + ' ' + obj.salesReduction;
- }
- }
- if (index == 1) {
- if (obj.yhfangs == 1 && obj.yhnum > 1) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeiyh');
- }
- if (obj.yhfangs == 1 && obj.yhnum < 1 && obj.yhnum > 0) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeizk');
- }
- if (obj.yhfangs == 1 && obj.yhnum == 0) { //优惠方式:1 运费,2 订单 ,3 商品
- str = this.$t('hongbaokq.yunfeiquanm');
- }
- if (obj.yhfangs == 2 && obj.yhnum > 1) {
- str = this.$t('hongbaokq.dingdanyh');
- }
- if (obj.yhfangs == 2 && obj.yhnum < 1) {
- str = this.$t('hongbaokq.dingdanzk');
- }
- if (obj.yhfangs == 3 && obj.yhnum > 1) {
- str = this.$t('hongbaokq.shangpinyh');
- }
- if (obj.yhfangs == 3 && obj.yhnum < 1) {
- str = this.$t('hongbaokq.shangpinzk');
- }
- if (obj.yhnum != 0) {
- str = str + ' ' + obj.yhnum;
- }
- }
- return str;
- },
- querenyhhd() {
- this.showpop = false;
- },
- //积分兑换
- jifenduihuan() {
- if (this.sumpoints > 0) {
- this.isjifenduihan = !this.isjifenduihan;
- } else {
- this.isjifenduihan = false;
- }
- },
- jisuandikou(dingdanjiner) {
- var sumkyjine = this.sumpoints * this.pointsBl;
- if (sumkyjine > dingdanjiner) {
- var jifen = dingdanjiner / this.pointsBl;
- jifen = parseInt(jifen);
- this.points = jifen;
- this.pointsReduction = jifen * this.pointsBl;
- } else {
- this.points = this.sumpoints;
- this.pointsReduction = sumkyjine;
- }
- return this.pointsReduction;
- },
- //商品数量加减
- jiajian(index, state) {
- if (this.actType > 0) {
- return;
- }
- var tempList = this.foodlist;
- if (state > 0) {
- var temp = tempList[index];
- temp.number = temp.number + 1;
- tempList[index] = temp;
- this.gengxingouwuche(temp);
- } else {
- var temp = tempList[index];
- if (temp.number > 1) {
- temp.number = temp.number - 1;
- tempList[index] = temp;
- } else {
- temp.number = temp.number - 1;
- tempList.splice(index, 1);
- }
- this.gengxingouwuche(temp);
- }
- this.foodlist = tempList;
- this.cuxiaoList();
- if (this.foodlist.length == 0) {
- uni.showToast({
- title: that.$t('comp.qingxzsp'),
- icon: 'none',
- duration: 2500
- })
- }
- },
- xuanzcux() {
- this.showpop = true;
- },
- chooseCancel() {
- this.showpop = false;
- this.zffsS = false;
- console.log('chooseCancel');
- },
- //--------------------------------------------------------
- arraytoStr(arry) {
- var str = '';
- if (arry.length > 0) {
- for (var i = 0; i < arry.length; i++) {
- str = str + arry[i] + '; ';
- }
- }
- return str;
- },
- jisuanjiner() {
- this.spxj = 0;
- this.hyyh = 0;
- this.zje = 0;
- for (var i = 0; i < this.foodlist.length; i++) {
- this.spxj = this.spxj + (this.foodlist[i].price + this.foodlist[i].otherPrice) * this.foodlist[i]
- .number;
- }
- this.hyyh = this.jisuanyouhuijiner(this.spxj);
- this.hyyh = parseInt(this.hyyh);
- this.zje = (this.spxj + this.psf) - this.hyyh;
- this.zje = parseInt(this.zje);
- //开始积分抵扣
- this.jisuandikou(this.zje)
- this.zje = this.zje - this.pointsReduction;
- this.zje = parseInt(this.zje);
- //
- },
- jisuanyouhuijiner(price) {
- var zongyouhui = 0;
- this.salesReduction = 0;
- this.mdSalesReduction = 0;
- this.discountAmount = 0;
- this.mdDiscountAmount = 0;
- if (this.cxList.length > 0) {
- for (var i = 0; i < this.cxList.length; i++) {
- var obj = this.cxList[i];
- console.log('111111', this.hdidpt, obj)
- if (obj.id == this.hdidpt) {
- console.log('111111', this.hdidpt, obj)
- if (obj.salesType == "1") {
- if (obj.salesReduction < 1) {
- this.salesReduction = this.psf * (100 - obj.salesReduction * 100) / 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > this.psf) {
- this.salesReduction = this.psf;
- } else {
- this.salesReduction = obj.salesReduction;
- }
- }
- }
- if (obj.salesType == "2") {
- if (obj.salesReduction < 1) {
- this.salesReduction = this.salesReduction + (price + this.psf) * (100 - obj
- .salesReduction * 100) / 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > (price + this.psf)) {
- this.salesReduction = (price + this.psf);
- } else {
- this.salesReduction = obj.salesReduction;
- }
- }
- console.log(price, obj.salesReduction, price * (1 - obj.salesReduction))
- }
- if (obj.salesType == "3") {
- if (obj.salesReduction < 1) {
- this.salesReduction = this.salesReduction + price * (100 - obj.salesReduction * 100) /
- 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > price) {
- this.salesReduction = price;
- } else {
- this.salesReduction = obj.salesReduction;
- }
- }
- }
- }
- if (obj.id == this.hdidsj) {
- console.log('1111112', this.hdidsj, obj)
- if (obj.salesType == "1") {
- this.mdSalesReduction = this.mdSalesReduction + this.psf;
- if (obj.salesReduction < 1) {
- this.mdSalesReduction = this.psf * (100 - obj.salesReduction * 100) / 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > this.psf) {
- this.mdSalesReduction = this.psf;
- } else {
- this.mdSalesReduction = obj.salesReduction;
- }
- }
- }
- if (obj.salesType == "2") {
- if (obj.salesReduction < 1) {
- this.mdSalesReduction = this.mdSalesReduction + (price + this.psf) * (100 - obj
- .salesReduction * 100) / 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > (price + this.psf)) {
- this.mdSalesReduction = (price + this.psf);
- } else {
- this.mdSalesReduction = obj.salesReduction;
- }
- }
- }
- if (obj.salesType == "3") {
- if (obj.salesReduction < 1) {
- this.mdSalesReduction = this.mdSalesReduction + price * (100 - obj.salesReduction *
- 100) / 100;
- } else if (obj.salesReduction > 1) {
- if (obj.salesReduction > price) {
- this.mdSalesReduction = price;
- } else {
- this.mdSalesReduction = obj.salesReduction;
- }
- }
- }
- }
- }
- }
- if (this.kqList.length > 0) {
- for (var i = 0; i < this.kqList.length; i++) {
- var obj = this.kqList[i];
- if (obj.id == this.kqidpt) {
- console.log('1111113', this.kqidpt, obj)
- if (obj.yhfangs == 1) {
- if (obj.yhnum < 1) {
- this.discountAmount = this.psf * (100 - obj.yhnum * 100) / 100;
- } else if (obj.yhnum > 1) {
- if (obj.yhnum > this.psf) {
- this.discountAmount = this.psf;
- } else {
- this.discountAmount = obj.yhnum;
- }
- }
- }
- if (obj.yhfangs == 2) {
- if (obj.yhnum < 1) {
- this.discountAmount = (price + this.psf) * (100 - obj.yhnum * 100) / 100;
- } else if (obj.yhnum > 1) {
- if (obj.yhnum > (price + this.psf)) {
- this.discountAmount = (price + this.psf);
- } else {
- this.discountAmount = obj.yhnum;
- }
- }
- console.log(price, obj.yhnum, price * (1 - obj.yhnum))
- }
- if (obj.yhfangs == 3) {
- if (obj.yhnum < 1) {
- this.discountAmount = price * (100 - obj.yhnum * 100) / 100;
- } else if (obj.yhnum > 1) {
- if (obj.yhnum > price) {
- this.discountAmount = price;
- } else {
- this.discountAmount = obj.yhnum;
- }
- }
- }
- }
- if (obj.id == this.kqidsj) {
- console.log('1111114', this.kqidsj, obj)
- if (obj.yhfangs == 1) {
- if (obj.yhnum < 1) {
- this.mdDiscountAmount = this.psf * (100 - obj.yhnum * 100) / 100;
- } else if (obj.yhnum > 1) {
- if (obj.yhnum > this.psf) {
- this.mdDiscountAmount = this.psf;
- } else {
- this.mdDiscountAmount = obj.yhnum;
- }
- }
- }
- if (obj.yhfangs == 2) { //订单
- if (obj.yhnum > 1) {
- if (obj.yhnum > (price + this.psf)) {
- this.mdDiscountAmount = (price + this.psf);
- } else {
- this.mdDiscountAmount = obj.yhnum;
- }
- } else {
- this.mdDiscountAmount = this.mdDiscountAmount + (price + this.psf) * (100 - obj.yhnum *
- 100) / 100;
- }
- console.log(price, obj.yhnum, price * (1 - obj.yhnum))
- }
- if (obj.yhfangs == 3) { //商品
- if (obj.yhnum > 1) {
- if (obj.yhnum > price) {
- this.mdDiscountAmount = price;
- } else {
- this.mdDiscountAmount = obj.yhnum;
- }
- } else {
- this.mdDiscountAmount = this.mdDiscountAmount + price * (100 - obj.yhnum * 100) / 100;
- }
- console.log(price, obj.yhnum, price * (1 - obj.yhnum))
- }
- }
- }
- }
- console.log(this.hdidpt, this.hdidsj, this.kqidpt, this.kqidsj)
- console.log(this.salesReduction, this.mdSalesReduction, this.discountAmount, this.mdDiscountAmount)
- zongyouhui = this.salesReduction + this.mdSalesReduction + this.discountAmount + this.mdDiscountAmount;
- console.log('zongyouhui:', zongyouhui);
- return zongyouhui;
- },
- sumfontnum(e) {
- this.remarks = e.target.value;
- },
- shifodaofu() {
- if (this.actType > 1) {
- return;
- }
- if (this.shifoudf == 0) {
- this.shifoudf = 1;
- } else {
- this.shifoudf = 0;
- }
- if (this.actType == 1 && this.shifoudf == 1) {
- this.actTitle = this.$t('index.huodaofukan');
- uni.showToast({
- title: this.$t('order.xuanzezhif'),
- icon: 'none',
- duration: 2500
- })
- } else if (this.actType == 1 && this.shifoudf == 0) {
- this.actTitle = this.$t('order.quzhifu');
- }
- console.log(this.shifoudf)
- },
- changaddr() {
- uni.navigateTo({
- url: '/pages/UserCenter/dizhi/dizhilist'
- })
- },
- yuyueshijian() {
- this.$refs.chooseTime.open()
- },
- changeTime(e) {
- //选择的时间
- console.log('选择的时间', e.value);
- this.delryTime = e.value;
- },
- deliveryclose() {
- this.delryTime = '';
- },
- peisong() {
- if (this.actType > 0) {
- return;
- }
- this.showAdrr = 0;
- this.peisongimg = '/static/images/peisongh@3x.png';
- this.ziquimg = '/static/images/ziqu@3x.png';
- this.tangshiimg = '/static/images/tangshih.png';
- this.Bcolor = 'whitesmoke';
- this.Bcolorr = 'lightgray';
- this.Bcolorrr = 'lightgray';
- this.Tcolor = 'black';
- this.Tcolorr = 'darkgray';
- this.Tcolorrr = 'darkgray';
- this.psf = parseFloat(this.freight);
- this.jisuanjiner();
- },
- ziqu() {
- if (this.actType > 0) {
- return;
- }
- this.showAdrr = 1;
- this.peisongimg = '/static/images/peisong@3x.png';
- this.ziquimg = '/static/images/ziquh@3x.png';
- this.tangshiimg = '/static/images/tangshih.png';
- this.Bcolor = 'lightgray';
- this.Bcolorr = 'whitesmoke';
- this.Bcolorrr = 'lightgray';
- this.Tcolor = 'darkgray';
- this.Tcolorr = 'black';
- this.Tcolorrr = 'darkgray';
- this.psf = 0;
- this.jisuanjiner();
- },
- tangshi() {
- this.showAdrr = 2;
- this.peisongimg = '/static/images/peisong@3x.png';
- this.ziquimg = '/static/images/ziqu@3x.png';
- this.tangshiimg = '/static/images/tangshi.png';
- this.Bcolor = 'lightgray';
- this.Bcolorr = 'lightgray';
- this.Bcolorrr = 'whitesmoke';
- this.Tcolor = 'darkgray';
- this.Tcolorr = 'darkgray';
- this.Tcolorrr = 'black';
- this.psf = 0;
- this.jisuanjiner();
- },
- //确认订单,要求下载app
- qufukuan() {
- if (this.foodlist.length == 0) {
- uni.showToast({
- title: this.$t('comp.qingxzsp'),
- icon: 'none',
- duration: 2500
- })
- return;
- }
- api('getAppDownload', {}, r => {
- console.log(r)
- uni.showModal({
- title: this.$t('api.message'),
- content: this.$t('jiesuan.xiazapp'),
- showCancel: true,
- cancelText: this.$t('jiesuan.xzios'),
- confirmText: this.$t('jiesuan.xiazandriod'),
- success: (res) => {
- if (res.confirm) {
- // 点击下载Android版本
- const isAndroid = this.isAndroidDevice();
- if (isAndroid) {
- // 安卓设备自动下载并安装
- this.downloadAndInstallAndroid(r.data.data.androidUrl);
- } else {
- // 非安卓设备直接打开下载链接
- window.open(r.data.data.androidUrl, '_blank');
- }
- } else if (res.cancel) {
- // 点击下载iOS版本
- this.downloadIOSApp(r.data.data.iosUrl);
- }
- }
- });
- return;
- });
- return
- if (this.keyixd == false) {
- uni.showToast({
- title: this.$t('mend.dianjiastatedy'),
- icon: 'none',
- duration: 2500
- })
- return;
- }
- if (this.actType == 2) { //已经支付过了!!
- // uni.showToast({
- // title: '已经支付过了!!',
- // icon: 'none',
- // duration: 2500
- // })
- return;
- }
- if (this.actType == 1) { //未支付,跳转支付
- this.zffsS = true;
- return;
- }
- var data;
- if (this.ddId.length > 0) {
- console.log('已经生成订单,不能重复提交');
- } else {
- this.ddId = '99' + new Date().valueOf();
- }
- var cretim = getApp().globalData.sj();
- // console.log(cretim);
- // return;
- if (this.showAdrr == 0) {
- if (this.dizhiID == '') {
- uni.showToast({
- title: this.$t('order.shdz'),
- icon: 'none',
- duration: 3500
- })
- return;
- }
- if (!this.isGetyunfei) {
- uni.showToast({
- title: this.$t('order.hqyfsb'),
- icon: 'none',
- duration: 3500
- })
- return;
- }
- data = {
- "ddId": this.ddId,
- "shId": this.userid,
- "mdId": this.mendid,
- "shdzId": this.dizhiID.id,
- "amount": this.zje,
- "remarks": this.remarks,
- "type": 0,
- "delryTime": this.delryTime, //new Date().toISOString(),
- "foodlist": this.foodlist,
- "freight": this.psf,
- "jvli": this.jvli,
- "longitude": this.mendianMs.longitude,
- "latitude": this.mendianMs.latitude,
- "collectPayment": this.shifoudf,
- "cretim": cretim,
- "yhId": this.kqidpt, //平台使用优惠券id
- "mdYhId": this.kqidsj, //门店优惠券id
- "activity": this.hdidpt, //平台促销活动id
- "mdActivity": this.hdidsj, //门店促销活动id
- "salesReduction": this.salesReduction, //平台促销減免值
- "mdSalesReduction": this.mdSalesReduction, //门店促销減免值
- "discountAmount": this.discountAmount, //平台优惠券优惠金额
- "mdDiscountAmount": this.mdDiscountAmount, //门店优惠券优惠金额
- "xiadanjiaoyan": 2
- }
- } else {
- data = {
- "ddId": this.ddId,
- "shId": this.userid,
- "mdId": this.mendid,
- "shdzId": '',
- "amount": this.zje,
- "remarks": this.remarks,
- "type": this.showAdrr,
- "delryTime": this.delryTime, // new Date().toISOString(),
- "foodlist": this.foodlist,
- "freight": this.psf,
- "jvli": this.jvli,
- "longitude": this.mendianMs.longitude,
- "latitude": this.mendianMs.latitude,
- "collectPayment": this.shifoudf,
- "cretim": cretim,
- "yhId": this.kqidpt, //平台使用优惠券id
- "mdYhId": this.kqidsj, //门店优惠券id
- "activity": this.hdidpt, //平台促销活动id
- "mdActivity": this.hdidsj, //门店促销活动id
- "salesReduction": this.salesReduction, //平台促销減免值
- "mdSalesReduction": this.mdSalesReduction, //门店促销減免值
- "discountAmount": this.discountAmount, //平台优惠券优惠金额
- "mdDiscountAmount": this.mdDiscountAmount, //门店优惠券优惠金额
- "xiadanjiaoyan": 2
- }
- }
- this.zhifuUrl = '';
- this.addorder(data);
- },
- getaddressList() {
- api('getaddressList', {}, r => {
- this.addrList = r.data.data;
- if (this.dizhiID != '') {
- console.log('3333')
- this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
- } else {
- if (this.addrList.length > 0) {
- console.log('2222')
- this.dizhiID = this.addrList[0];
- this.mpImage = this.dizhiID.annexes;
- this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
- }
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- getmendianDetail(id) {
- api('getmendianDetail', {
- id: id
- }, r => {
- this.mendianMs = r.data.data;
- console.log('getmendianDetail', this.mendianMs);
- if (this.mendianMs) {
- if (this.mendianMs.state == 1) {
- this.keyixd = false;
- }
- }
- if (this.dizhiID == '') {
- this.getaddressList();
- } else {
- console.log('111')
- this.getyunfei(this.dizhiID.latitude, this.dizhiID.longitude);
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- getyunfei(lat, lng) {
- if (this.mendianMs == '') {
- return;
- }
- //this.getjuliForyunfei(lat,lng);//前端请求规划路径
- //this.getjuliForyunfeiHT(lat,lng);//后端请求规划路径
- //先请求直线距离运费,如果规划路径运费小于直线距离则用直线距离的值
- //1--------在这个方法中调用规划计算
- console.log("getyunfei----------")
- this.zhixianyuanfei(lat, lng);
- },
- //通过坐标直线计算运费
- zhixianyuanfei(lat, lng) {
- var that = this;
- api('getyunfei', {
- lat1: lng,
- lng1: lat,
- lat2: this.mendianMs.longitude,
- lng2: this.mendianMs.latitude
- }, r => {
- console.log('直线运费');
- console.log(r);
- if (r.data.code != 200) {
- return;
- }
- that.freight = parseInt(r.data.data.freight);
- if (that.freight > 0) {} else {
- that.freight = 0;
- }
- that.zhixianfreight = that.freight;
- that.zhixianjuli = r.data.data.jvli;
- that.getjuliForyunfeiHT(lat, lng);
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- getjuliForyunfei(lat, lng) { //前端
- var data = {
- "origin": {
- "location": {
- "latLng": {
- "latitude": lat,
- "longitude": lng
- }
- }
- },
- "destination": {
- "location": {
- "latLng": {
- "latitude": this.mendianMs.latitude,
- "longitude": this.mendianMs.longitude
- }
- }
- },
- "travelMode": "DRIVE",
- "units": "METRIC" //米
- };
- console.log(data);
- api('getdistense', data, r => {
- console.log('getadvertis----', r);
- if (r.statusCode == 200) {
- var dist = r.data.routes[0].distanceMeters;
- console.log(dist / 1000);
- this.getyunfeiWithJuli(dist / 1000);
- console.log('路径运费');
- } else {
- this.zhixianyuanfei(lat, lng);
- console.log('路径计算距离失败!');
- uni.showToast({
- title: this.$t('api.wangluoshibai'),
- icon: 'none',
- duration: 3500
- })
- }
- }, failc => {
- console.log('getadvertis----', failc)
- })
- },
- getjuliForyunfeiHT(lat, lng) {
- var that = this;
- var latlng1 = '' + lat + ',' + lng;
- var latlng2 = '' + this.mendianMs.latitude + ',' + this.mendianMs.longitude;
- // var latlng1='10.715641,106.73932';//''+lat+','+lng;
- // var latlng2='10.754999,106.735601';//''+this.mendianMs.latitude+','+this.mendianMs.longitude;
- api('getluxianjvli', {
- latlng1: latlng1,
- latlng2: latlng2,
- id: this.userid
- }, r => {
- console.log('getjuliForyunfeiHT', r);
- if (r.data.code == 200) {
- if (r.data.data[0]) {
- var legs = r.data.data[0].legs;
- if (legs[0]) {
- var juli = legs[0].distance.value;
- // uni.showToast({
- // title:'通过轨迹计算运费',
- // icon: 'none',
- // duration: 3500
- // })
- if (juli > that.zhixianjuli) {
- that.getyunfeiWithJuli(juli / 1000);
- } else {
- that.psf = that.freight;
- that.jvli = that.zhixianjuli;
- that.isGetyunfei = true;
- console.log('直线运费');
- if (this.showAdrr == 0) {
- that.jisuanjiner();
- }
- }
- return;
- }
- }
- }
- that.psf = that.freight;
- that.jvli = that.zhixianjuli;
- that.isGetyunfei = true;
- console.log('直线运费');
- if (this.showAdrr == 0) {
- that.jisuanjiner();
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- getyunfeiWithJuli(distence) {
- var that = this;
- api('getZuiyyfei', {
- quli: JSON.stringify(distence)
- }, r => {
- console.log(r);
- if (r.data.code != 200) {
- return;
- }
- that.psf = parseInt(r.data.data.freight);
- if (that.psf > 0) {} else {
- that.psf = 0;
- }
- that.freight = that.psf;
- that.jvli = r.data.data.jvli;
- that.isGetyunfei = true;
- if (this.showAdrr == 0) {
- that.jisuanjiner();
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- addorder(data) {
- var that = this;
- uni.showLoading({
- title: 'Loading...',
- mask: true
- })
- console.log('addorder', data);
- api('addorder', data,
- r => {
- console.log(r);
- uni.hideLoading();
- if (r.data.code == 200) {
- this.qingkonggouwuche();
- this.ddId = data.ddId;
- this.rId = r.data.data.id;
- this.orderDetl = r.data.data;
- if (this.shifoudf == 0) {
- this.actType = 1;
- this.actTitle = that.$t('order.quzhifu');
- uni.showToast({
- title: that.$t('order.xuanzezhif'),
- icon: 'none',
- duration: 2500
- })
- } else {
- this.actType = 1;
- this.actTitle = that.$t('index.huodaofukan');
- //到付订单,直接更新支付状态
- this.huodaofukuan();
- }
- } else {
- uni.showToast({
- title: r.data.msg,
- icon: 'none',
- duration: 3000
- })
- }
- }, failc => {
- uni.hideLoading();
- //console.log('getadvertis----',failc)
- })
- },
- getVNPay() {
- api('setorderuzt', {
- id: this.rId,
- "collectPayment": 0
- }, res => {
- if (res.data.code != 200) {
- return;
- }
- }, failc => {
- return;
- })
- this.zffsS = false;
- var language = uni.getStorageSync('language');
- var lg;
- if (language == 'yuenan') {
- lg = 'vi';
- } else {
- lg = 'en';
- }
- uni.showLoading({
- title: 'Loading...',
- mask: true
- })
- api('VNPay', {
- orderid: this.ddId,
- amount: parseInt(this.zje),
- language: lg
- }, r => {
- uni.hideLoading();
- if (r.data.code != 200) {
- uni.showToast({
- title: r.data.msg,
- icon: 'none',
- duration: 3500
- })
- return;
- }
- this.shifouzhifu = true;
- this.zhifuUrl = '/pages/OrderList/buy/Zhifuyemian?url=' + encodeURIComponent(JSON.stringify(r
- .data.data)) + '&ddid=' + this.ddId;
- uni.navigateTo({
- url: '/pages/OrderList/buy/Zhifuyemian?url=' + encodeURIComponent(JSON.stringify(r
- .data.data)) + '&ddid=' + this.ddId
- })
- }, failc => {
- uni.hideLoading();
- //console.log('getadvertis----',failc)
- })
- },
- huodaofukuan() {
- this.shifoudf = 1;
- this.zffsS = false;
- uni.showLoading({
- title: 'Loading...',
- mask: true
- })
- var that = this;
- api('setorderuzt', {
- id: this.rId,
- "collectPayment": this.shifoudf
- }, res => {
- console.log('setorderuzt:', res)
- uni.hideLoading();
- if (res.data.code == 200) {
- this.actType = 2;
- this.actTitle = that.$t('order.yizhifu');
- uni.showToast({
- title: that.$t('order.xiadancg'),
- icon: 'none',
- duration: 2500,
- mask: true
- })
- setTimeout(function() {
- // 这里写要延时执行的代码
- uni.redirectTo({
- url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId +
- '&isShangjia=0'
- })
- }, 2500);
- } else {
- if (res.data.msg) {
- uni.showToast({
- title: res.data.msg,
- icon: 'none',
- duration: 2000
- })
- }
- }
- }, failc => {
- uni.hideLoading();
- //console.log('getadvertis----',failc)
- })
- },
- setorderuzt() {
- var that = this;
- api('setorderuzt', {
- id: this.rId,
- state: 1
- }, res => {
- this.actType = 2;
- this.actTitle = that.$t('order.yizhifu');
- uni.showToast({
- title: that.$t('order.xiadancg'),
- icon: 'none',
- duration: 2500,
- mask: true
- })
- setTimeout(function() {
- // 这里写要延时执行的代码
- uni.redirectTo({
- url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId + '&isShangjia=0'
- })
- }, 2500);
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- getorderDetl() {
- var that = this;
- api('getorderxq', {
- ddid: this.ddId
- }, r => {
- this.orderDetl = r.data.data;
- if (this.orderDetl.state == 1) {
- that.actType = 2;
- that.actTitle = that.$t('order.yizhifu');
- uni.showToast({
- title: that.$t('order.xiadancg'),
- icon: 'none',
- duration: 2500,
- mask: true
- })
- setTimeout(function() {
- // 这里写要延时执行的代码
- uni.redirectTo({
- url: '/pages/OrderList/OrderDetail?ddid=' + that.ddId +
- '&isShangjia=0'
- })
- }, 2500);
- }
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- qingkonggouwuche() {
- if (this.foodlist.length > 1) {
- uni.setStorageSync('gouwuche', '');
- return;
- }
- var gwc = uni.getStorageSync('gouwuche');
- var gouwuche;
- if ('' == gwc || null == gwc || undefined == gwc) {} else {
- gouwuche = JSON.parse(gwc);
- if (gouwuche.foodlist.length <= 1) {
- uni.setStorageSync('gouwuche', '');
- return;
- }
- for (var i = 0; i < gouwuche.foodlist.length; i++) {
- var sp = gouwuche.foodlist[i];
- if (this.foodlist[0].id == sp.id) {
- gouwuche.foodlist.splice(i, 1);
- let gwcS = JSON.stringify(gouwuche);
- uni.setStorageSync('gouwuche', gwcS);
- }
- }
- }
- },
- gengxingouwuche(item) {
- var gwc = uni.getStorageSync('gouwuche');
- if ('' == gwc || null == gwc || undefined == gwc) {
- return;
- }
- var gouwuche = JSON.parse(gwc);
- for (var i = 0; i < gouwuche.foodlist.length; i++) {
- var sp = gouwuche.foodlist[i];
- if (item.id == sp.id) {
- if (item.number > 0) {
- gouwuche.foodlist[i].number = item.number;
- } else {
- gouwuche.foodlist.splice(i, 1);
- }
- if (gouwuche.foodlist.length < 1) {
- uni.setStorageSync('gouwuche', '');
- } else {
- let gwcS = JSON.stringify(gouwuche);
- uni.setStorageSync('gouwuche', gwcS);
- }
- return;
- }
- }
- },
- pushMsg(cid, orderId) { //消息推送
- api('pushMsgSJ', {
- cid: cid,
- title: this.$t('order.xindd'),
- content: orderId,
- payload: ''
- }, res => {
- console.log(res)
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- },
- selectImage() {
- console.log('selectImage');
- this.$refs.yhdslCropper.chooseImage();
- },
- uploadImg(e) {
- console.log('------------uploadImg:', e)
- this.spImage = e;
- var that = this;
- uni.uploadFile({
- url: this.$upImagurl, //上传图片api
- filePath: e,
- name: 'file',
- header: {
- //"Authorization": userinfo.token
- },
- success: (res) => {
- let group = JSON.parse(res.data);
- that.mpImage = group.data;
- console.log(group)
- api('ADDaddress', {
- id: that.dizhiID.id,
- annexes: that.mpImage
- },
- res => {
- if (res.data.code == 200) {
- that.dizhiID.annexes = that.mpImage;
- uni.setStorageSync("peisongdizhi", that.dizhiID);
- }
- console.log('getGoodsDetail:', res);
- }, failc => {
- //console.log('getadvertis----',failc)
- })
- uni.showToast({
- title: that.$t('mend.shangccg'),
- icon: "success"
- })
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F2F3F7;
- }
- .contentV {
- width: 100%;
- position: relative;
- }
- .linesp {
- width: 100%;
- height: 8rpx;
- background-color: aliceblue;
- }
- .pinglun {
- margin: 16rpx;
- padding: 10rpx;
- width: 92%;
- height: 100rpx;
- border-radius: 15rpx;
- border: 2rpx solid lightgray;
- }
- .ctinrow {
- margin-top: 20rpx;
- width: 100%;
- height: 80rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- .delbtct {
- margin-left: 10%;
- margin-top: 20rpx;
- padding-bottom: 30rpx;
- width: 80%;
- }
- .delbt {
- text-align: center;
- font-size: 36rpx;
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- color: white;
- background-color: goldenrod;
- border-radius: 10rpx;
- }
- .topSwichV {
- height: 70rpx;
- width: 280rpx;
- border-radius: 35rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- .topSwichVL {
- margin-left: -40rpx;
- height: 70rpx;
- width: 200rpx;
- border-radius: 35rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- }
- .toppz {
- width: 50rpx;
- }
- .toppztext {
- font-size: 30rpx;
- }
- .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-left: auto;
- margin-right: 30rpx;
- }
- .actBTV {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .viewinrow {
- display: flex;
- flex-direction: row;
- align-items: center;
- width: 100%;
- }
- .kouweisku {
- padding-right: 10rpx;
- color: chocolate;
- font-size: 26rpx;
- }
- .shifdf {
- height: 90rpx;
- width: 90%;
- margin-left: 5%;
- align-items: center;
- }
- .shifdftext {
- margin-left: 30rpx;
- font-size: 30rpx;
- }
- .hdts {
- margin-left: 30rpx;
- font-size: 30rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .picker-view {
- width: 750rpx;
- height: 300rpx;
- margin-top: 10rpx;
- }
- .item {
- line-height: 100rpx;
- text-align: center;
- }
- .zhifbut {
- text-align: center;
- margin-top: 12rpx;
- margin-bottom: 12rpx;
- width: 80%;
- border-radius: 10rpx;
- color: white;
- line-height: 70rpx;
- }
- .imageRJ {
- width: 40rpx;
- height: 40rpx;
- margin-right: 8rpx;
- }
- .imageR {
- width: 40rpx;
- height: 40rpx;
- margin-right: 30rpx;
- }
- .textR {
- font-size: 26rpx;
- margin-left: 6rpx;
- margin-right: 6rpx;
- }
- </style>
|