yuyue.vue 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='order-submission'>
  4. <view class="headerCon" >
  5. <view class="add-title acea-row row-between-wrapper">
  6. <view class="acea-row row-middle">
  7. <view class="icon ">
  8. 门店选择</view>
  9. <view class="text add-text line1">线上下单</view>
  10. <view class="text add-text line1" v-if="deliveryType==3">{{system_store.name || '请选择门店'}}
  11. </view>
  12. </view>
  13. <view class="text" @tap='onDelivery'>
  14. 点击切换 <text class='iconfont icon-jiantou'></text></view>
  15. </view>
  16. <view class="address acea-row row-between-wrapper">
  17. <view class="addressCon" v-if="storeList.length>0">
  18. <view class='name acea-row row-middle'>
  19. <view class="nameCon line1 on">{{system_store.name || ''}}</view>
  20. </view>
  21. <view class="line1">
  22. {{system_store.address || ''}}{{system_store.detailed_address || ''}}
  23. </view>
  24. </view>
  25. <view class='addressCon' v-else>
  26. <view class='setaddress'>暂无门店信息</view>
  27. </view>
  28. <view class="icon acea-row row-middle" v-if="storeList.length>0">
  29. <view class="iconfont icon-dianhua" @click.stop="call(system_store.phone)"></view>
  30. <view class="iconfont icon-dingwei2" @click.stop="showMaoLocation(system_store)"></view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="allAddress" v-if="product_type == 0">
  35. <!-- #ifdef MP -->
  36. <!-- 桌码信息 -->
  37. <view v-if="tableId" class="table-header">
  38. <view class="top">
  39. <view class="name">{{ codeData.storeName.storeName }}</view>
  40. <view class="number"><text
  41. class="light">{{ codeData.category.name }}{{ codeData.table_number }}</text>号桌</view>
  42. </view>
  43. <view>{{ codeData.serial_number }}</view>
  44. </view>
  45. <!-- #endif -->
  46. <!-- 地址 -->
  47. <view v-if="!tableId" class='headerCon'>
  48. <view class="add-title acea-row row-between-wrapper">
  49. <view class="acea-row row-middle">
  50. <view class="icon" :class="deliveryType==1?'':deliveryType==3?'orange':'red'">
  51. {{deliveryType==1?'商城配送':deliveryType==2?'门店自提':'门店配送'}}
  52. </view>
  53. <view class="text add-text line1" v-if="deliveryType==1">由平台为您提供配送服务</view>
  54. <view class="text add-text line1" v-if="deliveryType==2">线上下单,到店自提</view>
  55. <view class="text add-text line1" v-if="deliveryType==3">{{system_store.name || '请选择门店'}}
  56. </view>
  57. </view>
  58. <view class="text" @tap='onDelivery'
  59. v-if="(isDisplay.length >1 || (isDisplay.length==1 && deliveryType !=1)) && store_func_status && goodsType != 9">
  60. 点击切换 <text class='iconfont icon-jiantou'></text></view>
  61. </view>
  62. <view class="address acea-row row-between-wrapper" @tap="onAddress(addressInfo.real_name)"
  63. v-if="deliveryType==1 || deliveryType==3">
  64. <view class="addressCon" v-if="addressInfo.real_name">
  65. <view class='name acea-row row-middle'>
  66. <view class="nameCon line1">{{addressInfo.real_name}}</view><text
  67. class='phone'>{{addressInfo.phone}}</text>
  68. </view>
  69. <view class="line1">
  70. <text class='default font-num'
  71. v-if="addressInfo.is_default">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street}}{{addressInfo.detail}}
  72. </view>
  73. </view>
  74. <view class='addressCon' v-else>
  75. <view class='setaddress'>设置收货地址</view>
  76. </view>
  77. <view class="iconfont icon-s-bianji"></view>
  78. </view>
  79. <view class="address acea-row row-between-wrapper" v-else>
  80. <view class="addressCon" v-if="storeList.length>0">
  81. <view class='name acea-row row-middle'>
  82. <view class="nameCon line1 on">{{system_store.name || ''}}</view>
  83. </view>
  84. <view class="line1">
  85. {{system_store.address || ''}}{{system_store.detailed_address || ''}}
  86. </view>
  87. </view>
  88. <view class='addressCon' v-else>
  89. <view class='setaddress'>暂无门店信息</view>
  90. </view>
  91. <view class="icon acea-row row-middle" v-if="storeList.length>0">
  92. <view class="iconfont icon-dianhua" @click.stop="call(system_store.phone)"></view>
  93. <view class="iconfont icon-dingwei2" @click.stop="showMaoLocation(system_store)"></view>
  94. </view>
  95. </view>
  96. </view>
  97. <view v-if="!tableId" class='line'>
  98. <image src='/static/images/line.jpg'></image>
  99. </view>
  100. </view>
  101. <view class="wrapper">
  102. <group-goods-list v-if="collage_id" :goods-list="goodsList"></group-goods-list>
  103. <orderGoods v-else :cartInfo="cartInfo" :giveData="giveData" :shippingType="shippingType"
  104. :product_type='product_type' :giveCartInfo="giveCartInfo"></orderGoods>
  105. </view>
  106. <view class='wrapper'>
  107. <view class="item acea-row row-between-wrapper" >
  108. <view>预约时间</view>
  109. <view class='discount' @click="openDatetimePicker">
  110. {{yytime || '请选择预约时间'}}
  111. <text class='iconfont icon-jiantou'></text>
  112. </view>
  113. </view>
  114. <!-- <view v-if="shippingType == 1">
  115. <view class="item acea-row row-between-wrapper">
  116. <view>联系人</view>
  117. <view class="discount">
  118. <input v-model="contacts" type="text" placeholder="请填写您的联系姓名"
  119. placeholder-class="placeholder"></input>
  120. </view>
  121. </view>
  122. <view class="item acea-row row-between-wrapper">
  123. <view>联系电话</view>
  124. <view class="discount">
  125. <input type="number" maxlength="11" v-model="contactsTel" placeholder="请填写您的联系电话"
  126. placeholder-class="placeholder"></input>
  127. </view>
  128. </view>
  129. </view> -->
  130. <!-- <view class='item' v-if="textareaStatus">
  131. <view>备注信息</view>
  132. <textarea placeholder-class='placeholder' placeholder="请添加备注(150字以内)" :always-embed="true"
  133. :adjust-position="true" cursor-spacing="30" v-if="!coupon.coupon" @input='bindHideKeyboard'
  134. :value="mark" :maxlength="150" name="mark">
  135. </textarea>
  136. </view> -->
  137. </view>
  138. <view class='wrapper' v-if="confirm.length">
  139. <view class='item acea-row row-between-wrapper'
  140. :class="{on:(item.name=='radios' || item.name=='checkboxs'),on2:item.name == 'dateranges',on3:item.name == 'citys'}"
  141. v-for="(item,index) in confirm" :key="index">
  142. <view class="name">
  143. <span class="asterisk" v-if="item.titleShow.val">*</span>
  144. {{ item.titleConfig.value }}
  145. </view>
  146. <!-- radio -->
  147. <view v-if="item.name=='radios'" class="discount">
  148. <radio-group @change="radioChange(e, index, item)" class="acea-row row-middle row-right">
  149. <label class="radio" v-for="(j,jindex) in item.wordsConfig.list" :key="jindex">
  150. <view class="acea-row row-middle">
  151. <!-- #ifndef MP -->
  152. <radio :value="jindex.toString()" :checked='j.show' />
  153. <!-- #endif -->
  154. <!-- #ifdef MP -->
  155. <radio :value="jindex" :checked='j.show' />
  156. <!-- #endif -->
  157. <view>{{j.val}}</view>
  158. </view>
  159. </label>
  160. </radio-group>
  161. </view>
  162. <!-- checkbox -->
  163. <view v-if="item.name=='checkboxs'" class="discount">
  164. <checkbox-group @change="checkboxChange($event, index, item)"
  165. class="acea-row row-middle row-right">
  166. <label class="radio" v-for="(j,jindex) in item.wordsConfig.list" :key="jindex">
  167. <view class="acea-row row-middle">
  168. <!-- #ifndef MP -->
  169. <checkbox :value="jindex.toString()" :checked="j.show"
  170. style="transform:scale(0.9)" />
  171. <!-- #endif -->
  172. <!-- #ifdef MP -->
  173. <checkbox :value="jindex" :checked="j.show" style="transform:scale(0.9)" />
  174. <!-- #endif -->
  175. <view>{{j.val}}</view>
  176. </view>
  177. </label>
  178. </checkbox-group>
  179. </view>
  180. <!-- text -->
  181. <view v-if="item.name=='texts' && item.valConfig.tabVal == 0" class="discount">
  182. <input type="text" :placeholder="item.tipConfig.value" placeholder-class="placeholder"
  183. v-model="item.value" />
  184. </view>
  185. <!-- number -->
  186. <view v-if="item.name=='texts' && item.valConfig.tabVal == 4" class="discount">
  187. <input type="number" :placeholder="item.tipConfig.value" placeholder-class="placeholder"
  188. v-model="item.value" />
  189. </view>
  190. <!-- email -->
  191. <view v-if="item.name=='texts' && item.valConfig.tabVal == 3" class="discount">
  192. <input type="text" :placeholder="item.tipConfig.value" placeholder-class="placeholder"
  193. v-model="item.value" />
  194. </view>
  195. <!-- data -->
  196. <view v-if="item.name=='dates'" class="discount">
  197. <picker mode="date" :value="item.value" @change="bindDateChange($event,index)">
  198. <view class="acea-row row-between-wrapper">
  199. <view v-if="item.value == ''">{{item.tipConfig.value}}</view>
  200. <view v-else>{{item.value}}</view>
  201. <text class='iconfont icon-jiantou'></text>
  202. </view>
  203. </picker>
  204. </view>
  205. <!-- dateranges -->
  206. <view v-if="item.name=='dateranges'" class="discount">
  207. <uni-datetime-picker v-model="item.value" type="daterange" @maskClick="maskClick">
  208. {{item.value.length?item.value[0]+' - '+item.value[1]:item.tipConfig.value}}
  209. <text class='iconfont icon-jiantou'></text>
  210. </uni-datetime-picker>
  211. </view>
  212. <!-- time -->
  213. <view v-if="item.name=='times'" class="discount">
  214. <picker mode="time" :value="item.value" @change="bindTimeChange($event,index)"
  215. :placeholder="item.tipConfig.value">
  216. <view class="acea-row row-between-wrapper">
  217. <view v-if="item.value == ''">{{item.tipConfig.value}}</view>
  218. <view v-else>{{item.value}}</view>
  219. <text class='iconfont icon-jiantou'></text>
  220. </view>
  221. </picker>
  222. </view>
  223. <!-- timeranges -->
  224. <view v-if="item.name=='timeranges'" class="discount acea-row row-between-wrapper"
  225. @click="getTimeranges(index)">
  226. <view v-if="item.value">{{item.value}}</view>
  227. <view v-else>{{item.tipConfig.value}}</view>
  228. <text class='iconfont icon-jiantou'></text>
  229. </view>
  230. <!-- select -->
  231. <view v-if="item.name=='selects'" class="discount">
  232. <picker :value="item.value" :range="item.wordsConfig.list"
  233. @change="bindSelectChange($event,index,item)" range-key="val">
  234. <view class="acea-row row-between-wrapper">
  235. <view v-if="item.value == ''">请选择</view>
  236. <view v-else>{{item.value}}</view>
  237. <text class='iconfont icon-jiantou'></text>
  238. </view>
  239. </picker>
  240. </view>
  241. <!-- city -->
  242. <view v-if="item.name=='citys'" class="discount" @click="changeRegion(index)">
  243. <view class="acea-row row-middle row-right">
  244. <view class="city" v-if="item.value == ''">{{item.tipConfig.value}}</view>
  245. <view class="city" v-else>{{item.value}}</view>
  246. <text class='iconfont icon-jiantou'></text>
  247. </view>
  248. </view>
  249. <!-- id -->
  250. <view v-if="item.name=='texts' && item.valConfig.tabVal == 2" class="discount">
  251. <input type="idcard" :placeholder="item.tipConfig.value" placeholder-class="placeholder"
  252. v-model="item.value" />
  253. </view>
  254. <!-- phone -->
  255. <view v-if="item.name=='texts' && item.valConfig.tabVal == 1" class="discount">
  256. <input type="number" :placeholder="item.tipConfig.value" placeholder-class="placeholder"
  257. v-model="item.value" />
  258. </view>
  259. <!-- img -->
  260. <view v-if="item.name=='uploadPicture'" class="confirmImg">
  261. <view class='upload acea-row row-middle'>
  262. <view class='pictrue' v-for="(items,indexs) in item.value" :key="indexs">
  263. <image :src='items' mode="aspectFill"></image>
  264. <!-- <view class='iconfont icon-guanbi1 font-num' @tap='DelPic(index,indexs)'></view> -->
  265. <view class="close acea-row row-center-wrapper" @tap='DelPic(index,indexs)'>
  266. <view class="iconfont icon-guanbi5"></view>
  267. </view>
  268. </view>
  269. <view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic(index)'
  270. v-if="item.value.length < item.numConfig.val">
  271. <text class='iconfont icon-icon25201'></text>
  272. <view>上传图片</view>
  273. </view>
  274. </view>
  275. </view>
  276. </view>
  277. </view>
  278. <view class='moneyList'>
  279. <scroll-view scroll-x="true" class="zp-wrap" @scrolltolower="">
  280. <view class="zp-item" v-for="ygitem in yg.list" @click="choosYg(ygitem)"
  281. :class="{'choose': ygitem.id == choose_yg.id}">
  282. <image :src="ygitem.avatar || '../../../static/images/avt.png'" mode="" class="zp-logo"></image>
  283. <view class="zp-name">{{ygitem.name}}</view>
  284. </view>
  285. </scroll-view>
  286. </view>
  287. <view class='moneyList'>
  288. <view class='item acea-row row-between-wrapper'>
  289. <view>商品总价:</view>
  290. <view class='money'>
  291. ¥{{payInfo.total_price}}
  292. </view>
  293. </view>
  294. <view class='item acea-row row-between-wrapper' v-if="payInfo.deduction_price">
  295. <view>优惠金额:</view>
  296. <view class='money'>
  297. ¥{{payInfo.deduction_price}}
  298. </view>
  299. </view>
  300. </view>
  301. <view class="height-add"></view>
  302. <view class='footer acea-row row-between-wrapper'>
  303. <view>合计:
  304. <text class='font-color'>¥{{payInfo.pay_price || 0}}</text>
  305. </view>
  306. <!-- <view class='settlement' style='z-index:100' @tap.stop="goPay"
  307. v-if="(((valid_count>0&&!discount_id) || (valid_count==cartInfo.length&&discount_id)) && shippingType) || (!shippingType && addressId) || product_type != 0">
  308. 立即结算</view>
  309. <view class='settlement bg-color-hui' style='z-index:100' v-else>立即结算</view> -->
  310. <view class='settlement' style='z-index:100' @tap.stop="goPay">立即结算</view>
  311. </view>
  312. </view>
  313. <view class="alipaysubmit" v-html="formContent"></view>
  314. <view class="tipaddress" v-show="isaddress">
  315. <view class="top"></view>
  316. <view class="bottom">
  317. <div class="font1">更新地址</div>
  318. <div class="font2">当前地址功能已更新,请重新修改</div>
  319. <div class="btn" @tap="payAddress">前往修改</div>
  320. </view>
  321. </view>
  322. <view class="mark" v-show="isaddress"></view>
  323. <couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' :cartId='cartId'
  324. @ChangCoupons="ChangCoupons"></couponListWindow>
  325. <addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :news='news' :address='address'
  326. :pagesUrl="pagesUrl" @OnChangeAddress="OnChangeAddress" @changeClose="changeClose">
  327. </addressWindow>
  328. <home v-show="!invShow && navigation"></home>
  329. <invoice-picker :inv-show="invShow" :inv-list="invList" :inv-checked="invChecked" :is-special="special_invoice"
  330. :url-query="urlQuery" @inv-close="invClose" @inv-change="invChange" @inv-cancel="invCancel">
  331. </invoice-picker>
  332. <payment v-if="totalPrice" :payMode="cartArr" :pay_close="pay_close" :isCall="true" :totalPrice="totalPrice"
  333. @changePayType="changePayType" @onChangeFun="onChangeFun"></payment>
  334. <deliveryMethod ref="deliveryMethod" :isDisplay="isDisplay" :storeList="storeList" :ptype="ptype"
  335. :storeSelfMention="store_self_mention" @deliveryFun="deliveryFun" @storeFun="storeFun"></deliveryMethod>
  336. <!-- #ifdef MP -->
  337. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  338. <!-- #endif -->
  339. <timeranges :isShow='isShow' :time='timeranges' @confrim="confrim" @cancel="cancels"></timeranges>
  340. <areaWindow ref="areaWindow" :display="display" :address='addressInfoArea' :cityShow='cityShow'
  341. @submit="OnAreaAddress" @changeClose="changeAddressClose"></areaWindow>
  342. <buuug7-simple-datetime-picker ref="myPicker" @submit="handleSubmit" @err="datetimePickerErr" :start-year="start_year"
  343. :end-year="2030" :time-hide="[true, true, true, true, true, false]"
  344. :time-label="['年', '月', '日', '时', '分', '秒']" />
  345. </view>
  346. </template>
  347. <script>
  348. const CACHE_CITY = {};
  349. import dayjs from '@/plugin/dayjs/dayjs.min.js';
  350. import {
  351. orderConfirm,
  352. getCouponsOrderPrice,
  353. orderCreate,
  354. postOrderComputed,
  355. checkShipping,
  356. computedServe,
  357. SubscribeCreate
  358. } from '@/api/order.js';
  359. import {
  360. getAddressDefault,
  361. getAddressDetail,
  362. invoiceList,
  363. invoiceOrder,
  364. getUserInfo
  365. } from '@/api/user.js';
  366. import {
  367. openPaySubscribe
  368. } from '@/utils/SubscribeMessage.js';
  369. import {
  370. storeListApi,
  371. getCollagePartake,
  372. getCodeData,
  373. getMen
  374. } from '@/api/store.js';
  375. import {
  376. CACHE_LONGITUDE,
  377. CACHE_LATITUDE
  378. } from '@/config/cache.js';
  379. import areaWindow from '@/components/areaWindow';
  380. import couponListWindow from '@/components/couponListWindow';
  381. import addressWindow from '@/components/addressWindow';
  382. import orderGoods from '@/components/orderGoods';
  383. import deliveryMethod from '../components/deliveryMethod/index.vue';
  384. import timeranges from '@/components/timeranges';
  385. import home from '@/components/home';
  386. import invoicePicker from '../components/invoicePicker';
  387. import groupGoodsList from '@/components/groupGoodsList/index.vue'
  388. import {
  389. toLogin
  390. } from '@/libs/login.js';
  391. import {
  392. mapGetters
  393. } from "vuex";
  394. import payment from '@/components/payment';
  395. import colors from "@/mixins/color";
  396. let newTime = new Date()
  397. export default {
  398. components: {
  399. payment,
  400. invoicePicker,
  401. couponListWindow,
  402. addressWindow,
  403. orderGoods,
  404. home,
  405. deliveryMethod,
  406. timeranges,
  407. areaWindow,
  408. groupGoodsList
  409. },
  410. mixins: [colors],
  411. data() {
  412. return {
  413. start_year: newTime.getFullYear(),
  414. addressInfoArea: [],
  415. cityShow: 2,
  416. display: false,
  417. timeranges: [],
  418. isShow: false,
  419. giveData: {
  420. give_integral: 0,
  421. give_coupon: []
  422. },
  423. giveCartInfo: [],
  424. confirm: [], //自定义留言
  425. id: 0,
  426. isaddress: false,
  427. textareaStatus: true,
  428. //支付方式
  429. cartArr: [{
  430. "name": "微信支付",
  431. "icon": "icon-weixin2",
  432. value: 'weixin',
  433. title: '使用微信快捷支付',
  434. payStatus: 1,
  435. },
  436. {
  437. "name": "支付宝支付",
  438. "icon": "icon-zhifubao",
  439. value: 'alipay',
  440. title: '使用线上支付宝支付',
  441. payStatus: 1,
  442. },
  443. {
  444. "name": "余额支付",
  445. "icon": "icon-yuezhifu",
  446. value: 'yue',
  447. title: '可用余额:',
  448. payStatus: 1,
  449. },
  450. // {
  451. // "name": "线下支付",
  452. // "icon": "icon-yuezhifu1",
  453. // value: 'offline',
  454. // title: '选择线下付款方式',
  455. // payStatus: 2,
  456. // }
  457. ],
  458. formContent: '',
  459. payType: 'weixin', //支付方式
  460. openType: 1, //优惠券打开方式 1=使用
  461. active: 0, //支付方式切换
  462. coupon: {
  463. coupon: false,
  464. list: [],
  465. statusTile: '立即使用'
  466. }, //优惠券组件
  467. address: {
  468. address: false
  469. }, //地址组件
  470. addressInfo: {}, //地址信息
  471. pinkId: 0, //拼团id
  472. addressId: 0, //地址id
  473. couponId: 0, //优惠券id
  474. cartId: '', //购物车id
  475. BargainId: 0,
  476. combinationId: 0,
  477. seckillId: 0,
  478. discountId: 0,
  479. userInfo: {}, //用户信息
  480. mark: '', //备注信息
  481. couponTitle: '请选择', //优惠券
  482. coupon_price: 0, //优惠券抵扣金额
  483. promotions_detail: [], //优惠活动金额明细
  484. useIntegral: false, //是否使用积分
  485. integral_price: 0, //积分抵扣金额
  486. integral: 0,
  487. ChangePrice: 0, //使用积分抵扣变动后的金额
  488. formIds: [], //收集formid
  489. status: 0,
  490. is_address: false,
  491. toPay: false, //修复进入支付时页面隐藏从新刷新页面
  492. shippingType: 0,
  493. system_store: {},
  494. storePostage: 0,
  495. contacts: '',
  496. contactsTel: '',
  497. mydata: {},
  498. storeList: [],
  499. store_self_mention: 0, //是开启门店自提;
  500. store_func_status: false, //是否开启门店自提和门店配送;
  501. cartInfo: [],
  502. priceGroup: {},
  503. animated: false,
  504. totalPrice: 0,
  505. integralRatio: "0",
  506. pagesUrl: "",
  507. orderKey: "",
  508. // usableCoupon: {},
  509. offlinePostage: "",
  510. isAuto: false, //没有授权的不会自动授权
  511. isShowAuth: false, //是否隐藏授权
  512. from: '',
  513. news: 1,
  514. invTitle: '不开发票',
  515. special_invoice: false,
  516. invoice_func: false,
  517. integral_ratio_status: 1,
  518. header_type: '',
  519. invShow: false,
  520. invList: [],
  521. invChecked: '',
  522. urlQuery: '',
  523. pay_close: false,
  524. noCoupon: 0,
  525. valid_count: 0,
  526. discount_id: 0,
  527. storeId: 0,
  528. product_type: 1,
  529. newImg: [],
  530. isDisplay: [],
  531. deliveryType: 1,
  532. goodsType: 0,
  533. product_id: 0,
  534. selectIndex: 0,
  535. timerangesIndex: 0,
  536. collage_id: 0,
  537. goodsList: [],
  538. tableId: 0,
  539. codeData: {},
  540. ptype: 1,
  541. yytime: '',//预约时间
  542. yg: {
  543. page: 1,
  544. limit: 100,
  545. list: [],
  546. loadingType: 'loadmore',
  547. loaded: false,
  548. },
  549. choose_yg: {
  550. },
  551. payInfo: {},
  552. };
  553. },
  554. computed: mapGetters(['isLogin']),
  555. onLoad: function(options) {
  556. this.ptype = options.product_type
  557. // #ifdef H5
  558. this.from = this.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
  559. // #endif
  560. // #ifdef MP
  561. this.from = 'routine'
  562. // #endif
  563. this.product_id = options.product_id || 0;
  564. this.getUserInfo()
  565. this.computedServe()
  566. this.getList()
  567. this.ptype = 6
  568. // if (!options.cartId) return this.$util.Tips({
  569. // title: '请选择要购买的商品'
  570. // }, {
  571. // tab: 3,
  572. // url: 1
  573. // });
  574. // this.deliveryType = options.delivery_type || 1;
  575. // if (this.deliveryType == 1 || this.deliveryType == 3) {
  576. // this.addressId = options.addressId || 0;
  577. // this.system_store.name = options.store_name;
  578. // }
  579. // if (this.deliveryType == 2 || this.deliveryType == 3) {
  580. // this.storeId = options.store_id || 0;
  581. // this.system_store.id = options.store_id || 0;
  582. // }
  583. // this.couponId = options.couponId || 0;
  584. // this.noCoupon = options.noCoupon || 0;
  585. // this.product_id = options.product_id || 0;
  586. // this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
  587. // this.cartId = options.cartId;
  588. // this.is_address = options.is_address ? true : false;
  589. // this.news = !options.new || options.new === '0' ? 0 : 1;
  590. // uni.setStorageSync('news', this.news);
  591. // this.invChecked = options.invoice_id || '';
  592. // this.header_type = options.header_type || '1';
  593. // this.couponTitle = options.couponTitle || '请选择'
  594. // switch (options.invoice_type) {
  595. // case '1':
  596. // this.invTitle = '增值税电子普通发票';
  597. // break;
  598. // case '2':
  599. // this.invTitle = '增值税电子专用发票';
  600. // break;
  601. // }
  602. // if (options.invoice_name) {
  603. // this.invTitle = options.invoice_name;
  604. // }
  605. // // #ifndef APP-PLUS
  606. // this.textareaStatus = true;
  607. // // #endif
  608. // if (this.isLogin && this.toPay == false) {
  609. // this.getCheckShipping();
  610. // } else {
  611. // toLogin();
  612. // }
  613. // this.collage_id = options.collage_id || 0;
  614. // if (this.collage_id) {
  615. // this.getCollagePartake();
  616. // }
  617. // // #ifdef MP
  618. // // 桌码
  619. // this.tableId = options.tableId || 0;
  620. // if (this.tableId) {
  621. // this.getCodeData();
  622. // }
  623. // // #endif
  624. },
  625. /**
  626. * 生命周期函数--监听页面显示
  627. */
  628. onShow: function() {
  629. uni.removeStorageSync('form_type_cart');
  630. let _this = this
  631. uni.$on("handClick", res => {
  632. if (res) {
  633. _this.system_store = res.address
  634. _this.storeId = _this.system_store.id
  635. _this.cartId = res.cartId
  636. _this.news = res.new
  637. _this.pinkId = Number(res.pinkId)
  638. _this.couponId = res.couponId
  639. _this.getConfirm()
  640. }
  641. // 清除监听
  642. uni.$off('handClick');
  643. })
  644. let current = (dayjs(new Date(Number(new Date().getTime()))).format('HH:mm')).split(':');
  645. let currentArray = current;
  646. currentArray.push(0);
  647. let arrayNew = [];
  648. [...currentArray, ...current].forEach(item => {
  649. arrayNew.push(Number(item))
  650. })
  651. this.timeranges = arrayNew;
  652. },
  653. methods: {
  654. getUserInfo() {
  655. let that = this
  656. getUserInfo().then(res => {
  657. this.userInfo = res.data
  658. //微信支付是否开启
  659. that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
  660. //支付宝是否开启
  661. that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
  662. //#ifdef MP
  663. that.cartArr[1].payStatus = 0;
  664. //#endif
  665. //余额支付是否开启
  666. that.cartArr[2].title = '可用余额:' + this.userInfo.now_money;
  667. that.cartArr[2].number = this.userInfo.now_money;
  668. })
  669. },
  670. computedServe() {
  671. computedServe({
  672. products: this.product_id
  673. }).then(ress => {
  674. console.log(ress)
  675. this.payInfo = ress.data
  676. this.totalPrice = ress.data.pay_price + ''
  677. console.log(this.totalPrice,'this.totalPrice')
  678. })
  679. },
  680. // 选择员工
  681. choosYg(item) {
  682. this.choose_yg = item
  683. },
  684. // 获取员工列表
  685. getMen() {
  686. let that = this
  687. if(that.yg.loadingType == 'noMore' || that.yg.loadingType == 'loading' ) {
  688. return
  689. }
  690. that.yg.loadingType = 'loading'
  691. getMen({
  692. page: that.yg.page,
  693. limit: that.yg.limit,
  694. store_id: this.system_store.id
  695. }).then(res => {
  696. console.log(res)
  697. let arr = []
  698. arr = arr.concat(res.data.list)
  699. that.yg.list = that.yg.list.concat(arr)
  700. if(that.yg.limit == res.data.list.length) {
  701. that.yg.loadingType = 'more'
  702. that.yg.page++
  703. }else {
  704. that.yg.loadingType = 'noMore'
  705. }
  706. that.yg.loaded = true
  707. })
  708. },
  709. // 打开picker
  710. openDatetimePicker() {
  711. this.$refs.myPicker.show();
  712. },
  713. // 关闭picker
  714. closeDatetimePicker() {
  715. this.$refs.myPicker.hide();
  716. },
  717. datetimePickerErr() {
  718. this.yytime = ''
  719. },
  720. handleSubmit(e) {
  721. console.log(e);
  722. this.yytime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`;
  723. },
  724. // #ifdef MP
  725. // 桌码信息
  726. getCodeData() {
  727. getCodeData({
  728. tableId: this.tableId
  729. }).then(res => {
  730. this.codeData = res.data;
  731. });
  732. },
  733. // #endif
  734. getCollagePartake() {
  735. getCollagePartake({
  736. collage_id: this.collage_id
  737. }).then(res => {
  738. this.goodsList = res.data;
  739. });
  740. },
  741. OnAreaAddress(address) {
  742. let addr = '';
  743. if (address.length == 4) {
  744. addr = address[0].label + '/' + address[1].label + '/' + address[2].label + '/' + address[3].label;
  745. } else if (address.length == 3) {
  746. addr = address[0].label + '/' + address[1].label + '/' + address[2].label;
  747. } else if (address.length == 2) {
  748. addr = address[0].label + '/' + address[1].label;
  749. } else {
  750. addr = address[0].label;
  751. }
  752. this.confirm[this.timerangesIndex].value = addr;
  753. CACHE_CITY[this.timerangesIndex] = address;
  754. },
  755. changeRegion(index) {
  756. if (!this.confirm[index].value) {
  757. this.addressInfoArea = [];
  758. }
  759. this.timerangesIndex = index;
  760. this.cityShow = Number(this.confirm[index].valConfig.tabVal) + 1;
  761. this.display = true;
  762. if (CACHE_CITY[index]) {
  763. this.addressInfoArea = CACHE_CITY[index];
  764. }
  765. },
  766. // 关闭地址弹窗;
  767. changeAddressClose: function() {
  768. this.display = false;
  769. },
  770. maskClick(e) {
  771. console.log(e);
  772. },
  773. // 授权关闭
  774. authColse: function(e) {
  775. this.isShowAuth = e
  776. },
  777. showMaoLocation(e) {
  778. let self = this;
  779. // #ifdef H5
  780. if (self.$wechat.isWeixin()) {
  781. self.$wechat.seeLocation({
  782. latitude: Number(e.latitude),
  783. longitude: Number(e.longitude),
  784. name: e.name,
  785. scale: 13,
  786. address: `${e.address}-${e.detailed_address}`,
  787. }).then(res => {})
  788. } else {
  789. // #endif
  790. uni.openLocation({
  791. latitude: Number(e.latitude),
  792. longitude: Number(e.longitude),
  793. name: e.name,
  794. address: `${e.address}-${e.detailed_address}`,
  795. success: function() {
  796. Number
  797. }
  798. });
  799. // #ifdef H5
  800. }
  801. // #endif
  802. },
  803. call(phone) {
  804. uni.makePhoneCall({
  805. phoneNumber: phone,
  806. });
  807. },
  808. // 选中配送类型
  809. deliveryFun(e, item) {
  810. this.deliveryType = e;
  811. this.$refs.deliveryMethod.module = false;
  812. if (e == 2) {
  813. this.storeId = item.id;
  814. } else {
  815. if (e == 3) {
  816. this.storeId = item.id;
  817. if (this.isDisplay.includes("2") && this.isDisplay.includes("3")) {
  818. this.getaddressInfo();
  819. this.$nextTick(function() {
  820. this.$refs.addressWindow.getAddressList();
  821. })
  822. }
  823. }
  824. this.system_store = item;
  825. }
  826. if (e == 1 || e == 3) {
  827. this.addressType(0, e);
  828. } else {
  829. this.addressType(1, e);
  830. }
  831. },
  832. // 选择配送方式
  833. onDelivery() {
  834. this.$refs.deliveryMethod.module = true
  835. },
  836. // 子集调用门店列表接口
  837. storeFun(index) {
  838. this.getList(1, index);
  839. },
  840. // 是否显示快递配送
  841. getCheckShipping() {
  842. let data = {
  843. cartId: this.cartId,
  844. new: this.news
  845. }
  846. checkShipping(data).then(res => {
  847. // 1:快递配送,2:到店自提,3:门店配送
  848. res.data.type.sort((x, y) => x - y) //正序
  849. this.isDisplay = res.data.type;
  850. if (((this.isDisplay.includes("2") && this.isDisplay.length == 1) || (this.deliveryType == 2 &&
  851. !this.tableId) || (this.deliveryType == 3 && this.storeId > 0 && !this.system_store
  852. .name)) && this.isDisplay.length) {
  853. if ((this.deliveryType == 2 || (this.deliveryType == 3 && !this.isDisplay.includes(
  854. "3"))) && this.isDisplay.includes("2")) {
  855. this.deliveryType = 2
  856. this.addressType(1, this.deliveryType);
  857. }
  858. if ((this.deliveryType == 3 || (this.deliveryType == 2 && !this.isDisplay.includes(
  859. "2"))) && this.isDisplay.includes("3")) {
  860. this.deliveryType = 3
  861. this.addressType(0, this.deliveryType);
  862. this.getaddressInfo();
  863. this.$nextTick(function() {
  864. this.$refs.addressWindow.getAddressList();
  865. })
  866. }
  867. } else {
  868. this.getaddressInfo();
  869. this.getConfirm();
  870. this.$nextTick(function() {
  871. this.$refs.addressWindow.getAddressList();
  872. })
  873. }
  874. }).catch(err => {
  875. uni.showToast({
  876. title: err,
  877. icon: 'none'
  878. });
  879. })
  880. },
  881. /**
  882. * 删除图片
  883. *
  884. */
  885. DelPic: function(index, indexs) {
  886. let that = this,
  887. pic = this.confirm[index].value;
  888. that.confirm[index].value.splice(indexs, 1);
  889. that.$set(that.confirm[index], 'value', that.confirm[index].value);
  890. },
  891. /**
  892. * 上传文件
  893. *
  894. */
  895. uploadpic: function(index) {
  896. let that = this;
  897. this.$util.uploadImageOne('upload/image', function(res) {
  898. that.newImg.push(res.data.url);
  899. that.$set(that.confirm[index], 'value', that.newImg);
  900. });
  901. },
  902. // 不开发票
  903. invCancel() {
  904. this.invChecked = '';
  905. this.invTitle = '不开发票';
  906. this.invShow = false;
  907. },
  908. // 选择发票
  909. invChange(id) {
  910. this.invChecked = id;
  911. this.invShow = false;
  912. const result = this.invList.find(item => item.id === id);
  913. let name = '';
  914. name += result.header_type === 1 ? '个人' : '企业';
  915. name += result.type === 1 ? '普通' : '专用';
  916. name += '发票';
  917. this.invTitle = name;
  918. },
  919. // 关闭发票
  920. invClose() {
  921. this.invShow = false;
  922. this.getInvoiceList()
  923. },
  924. getInvoiceList() {
  925. uni.showLoading({
  926. title: '正在加载…'
  927. })
  928. invoiceList().then(res => {
  929. uni.hideLoading();
  930. this.invList = res.data.map(item => {
  931. item.id = item.id.toString();
  932. return item;
  933. });
  934. const result = this.invList.find(item => item.id == this.invChecked);
  935. if (result) {
  936. let name = '';
  937. name += result.header_type === 1 ? '个人' : '企业';
  938. name += result.type === 1 ? '普通' : '专用';
  939. name += '发票';
  940. this.invTitle = name;
  941. }
  942. }).catch(err => {
  943. uni.showToast({
  944. title: err,
  945. icon: 'none'
  946. });
  947. });
  948. },
  949. /**
  950. * 开发票
  951. */
  952. goInvoice: function() {
  953. this.getInvoiceList()
  954. this.invShow = true;
  955. this.urlQuery =
  956. `new=${this.news}&cartId=${this.cartId}&pinkId=${this.pinkId}&couponId=${this.couponId}&addressId=${this.addressId}&specialInvoice=${this.special_invoice}&couponTitle=${this.couponTitle}&delivery_type=${this.deliveryType}&store_id=${this.storeId}&store_name=${this.system_store.name}&product_id=${this.product_id}`;
  957. },
  958. /**
  959. * 授权回调事件
  960. *
  961. */
  962. onLoadFun: function() {
  963. this.getCheckShipping();
  964. this.isShowAuth = false;
  965. //调用子页面方法授权后执行获取地址列表
  966. // this.$scope.selectComponent('#address-window').getAddressList();
  967. },
  968. /**
  969. * 事件回调
  970. *
  971. */
  972. onChangeFun: function(e) {
  973. // let opt = e;
  974. // let action = opt.action || null;
  975. // let value = opt.value != undefined ? opt.value : null;
  976. // action && this[action] && this[action](value);
  977. console.log(e)
  978. let that = this
  979. if(e.action == 'payClose') {
  980. this.pay_close = false
  981. }else {
  982. SubscribeCreate({
  983. uid: this.userInfo.uid,
  984. work_member_id: this.choose_yg.id,
  985. products: this.product_id,
  986. pay_type: e.value,
  987. store_id: that.system_store.id,
  988. reservation_time: that.yytime,
  989. }).then(res => {
  990. that.$util.Tips({
  991. title: '支付成功',
  992. icon: 'success'
  993. }, {
  994. tab: 4,
  995. url: goPages
  996. });
  997. setTimeout(()=> {
  998. uni.switchTab({
  999. url: '/pages/index/index'
  1000. })
  1001. },1500)
  1002. })
  1003. }
  1004. },
  1005. payClose: function() {
  1006. this.pay_close = false;
  1007. },
  1008. goPay() {
  1009. if(!this.choose_yg.id) {
  1010. return this.$util.Tips({
  1011. title: '请选择预约员工'
  1012. });
  1013. }
  1014. if(!this.yytime) {
  1015. return this.$util.Tips({
  1016. title: '请选择预约时间'
  1017. });
  1018. }
  1019. this.formVerify();
  1020. },
  1021. payCheck(type) {
  1022. this.payType = type;
  1023. this.SubOrder();
  1024. },
  1025. payAddress() {
  1026. uni.navigateTo({
  1027. // /pages/users/user_address/index?id=25&cartId=76179610656654229504&pinkId=0&couponId=0&new=1
  1028. url: '/pages/users/user_address/index?id=' + this.id + '&new=' + this.news + '&cartId=' + this
  1029. .cartId +
  1030. '&pinkId=' +
  1031. this.pinkId +
  1032. '&couponId=' +
  1033. this.couponId + '&delivery_type=' + this.deliveryType + '&addressId=' + this.addressId +
  1034. '&store_id=' + this.storeId + '&store_name=' + this.system_store.name + '&product_id=' +
  1035. this.product_id
  1036. })
  1037. },
  1038. /**
  1039. * 获取门店列表数据
  1040. */
  1041. getList: function(fromType, index) {
  1042. let longitude = uni.getStorageSync("user_longitude"); //经度
  1043. let latitude = uni.getStorageSync("user_latitude"); //纬度
  1044. let data = {
  1045. latitude: latitude, //纬度
  1046. longitude: longitude, //经度
  1047. page: 1,
  1048. limit: 100,
  1049. type: this.seckillId > 0 ? 1 : 0,
  1050. product_id: this.product_id,
  1051. is_store: index
  1052. }
  1053. storeListApi(data).then(res => {
  1054. let list = res.data.list.list || [];
  1055. this.$set(this, 'storeList', list);
  1056. this.$set(this, 'storeId', this.storeId != 0 ? this.storeId : list[0].id);
  1057. list.forEach(item => {
  1058. if (this.storeId == item.id) {
  1059. this.$set(this, 'system_store', item);
  1060. }
  1061. })
  1062. if (fromType != 1) {
  1063. this.getConfirm();
  1064. }
  1065. this.yg.list = []
  1066. this.yg.loadingType = 'more'
  1067. this.yg.page = 1
  1068. this.getMen()
  1069. }).catch(err => {})
  1070. },
  1071. // 关闭地址弹窗;
  1072. changeClose: function() {
  1073. this.$set(this.address, 'address', false);
  1074. },
  1075. /*
  1076. * 跳转门店列表
  1077. */
  1078. showStoreList: function() {
  1079. let _this = this
  1080. if (this.storeList.length > 0) {
  1081. uni.navigateTo({
  1082. url: `/pages/store/store_list/index?type=1&cartId=${_this.cartId}&new=${_this.news}&pinkId=${_this.pinkId}&couponId=${_this.couponId}`
  1083. })
  1084. }
  1085. },
  1086. changePayType(type) {
  1087. this.payType = type
  1088. this.computedPrice()
  1089. },
  1090. computedPrice: function() {
  1091. let shippingType = this.shippingType;
  1092. postOrderComputed(this.orderKey, {
  1093. addressId: this.addressId,
  1094. useIntegral: this.useIntegral ? 1 : 0,
  1095. couponId: this.priceGroup.couponPrice == 0 ? 0 : this.couponId,
  1096. shipping_type: this.tableId ? 4 : parseInt(shippingType) + 1,
  1097. payType: this.payType
  1098. }).then(res => {
  1099. let result = res.data.result;
  1100. if (result) {
  1101. this.totalPrice = result.pay_price;
  1102. this.integral_price = result.deduction_price;
  1103. this.coupon_price = result.coupon_price;
  1104. this.promotions_detail = result.promotions_detail;
  1105. this.integral = this.useIntegral ? result.SurplusIntegral : this.userInfo.integral;
  1106. this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
  1107. this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
  1108. }
  1109. }).catch(err => {
  1110. return that.$util.Tips({
  1111. title: err
  1112. });
  1113. })
  1114. },
  1115. addressType: function(e, type) {
  1116. let index = e;
  1117. this.shippingType = parseInt(index);
  1118. // this.computedPrice();
  1119. if (index == 1) {
  1120. this.getList(0, type);
  1121. } else {
  1122. this.getConfirm();
  1123. }
  1124. },
  1125. bindPickerChange: function(e) {
  1126. let value = e.detail.value;
  1127. this.shippingType = value;
  1128. this.computedPrice();
  1129. },
  1130. ChangCouponsClone: function() {
  1131. this.$set(this.coupon, 'coupon', false);
  1132. },
  1133. changeTextareaStatus: function() {
  1134. for (let i = 0, len = this.coupon.list.length; i < len; i++) {
  1135. this.coupon.list[i].use_title = '';
  1136. this.coupon.list[i].is_use = 0;
  1137. }
  1138. this.textareaStatus = true;
  1139. this.status = 0;
  1140. this.$set(this.coupon, 'list', this.coupon.list);
  1141. },
  1142. /**
  1143. * 处理点击优惠券后的事件
  1144. *
  1145. */
  1146. ChangCoupons: function(e) {
  1147. // this.usableCoupon = e
  1148. // this.coupon.coupon = false
  1149. let index = e,
  1150. list = this.coupon.list,
  1151. couponTitle = '请选择',
  1152. couponId = 0;
  1153. for (let i = 0, len = list.length; i < len; i++) {
  1154. if (i != index) {
  1155. list[i].use_title = '';
  1156. list[i].is_use = 0;
  1157. }
  1158. }
  1159. if (list[index].is_use) {
  1160. //不使用优惠券
  1161. list[index].use_title = '';
  1162. list[index].is_use = 0;
  1163. } else {
  1164. //使用优惠券
  1165. list[index].use_title = '不使用';
  1166. list[index].is_use = 1;
  1167. couponTitle = list[index].coupon_title;
  1168. couponId = list[index].id;
  1169. }
  1170. this.couponTitle = couponTitle;
  1171. this.couponId = couponId;
  1172. this.$set(this.coupon, 'coupon', false);
  1173. this.$set(this.coupon, 'list', list);
  1174. this.getConfirm(1);
  1175. },
  1176. /**
  1177. * 使用积分抵扣
  1178. */
  1179. ChangeIntegral: function() {
  1180. this.useIntegral = !this.useIntegral;
  1181. this.computedPrice();
  1182. },
  1183. /**
  1184. * 选择地址后改变事件
  1185. * @param object e
  1186. */
  1187. OnChangeAddress: function(e) {
  1188. this.textareaStatus = true;
  1189. this.addressId = e;
  1190. this.address.address = false;
  1191. this.getConfirm()
  1192. this.getaddressInfo();
  1193. this.computedPrice();
  1194. },
  1195. bindHideKeyboard: function(e) {
  1196. this.mark = e.detail.value;
  1197. },
  1198. // 对象转数组
  1199. objToArr(data) {
  1200. let obj = Object.keys(data);
  1201. let m = obj.map(key => data[key]);
  1202. return m;
  1203. },
  1204. /**
  1205. * 获取当前订单详细信息
  1206. *
  1207. */
  1208. getConfirm: function(numType) {
  1209. // let that = this;
  1210. // let shippingType = parseInt(this.shippingType) + 1;
  1211. // let addressId = 0,
  1212. // storeid;
  1213. // if (this.tableId) {
  1214. // shippingType = 4;
  1215. // }
  1216. // if (shippingType == 1) {
  1217. // addressId = that.addressId
  1218. // if (this.deliveryType == 1) {
  1219. // storeid = 0
  1220. // } else {
  1221. // storeid = that.storeId
  1222. // }
  1223. // } else {
  1224. // addressId = ''
  1225. // storeid = that.storeId
  1226. // }
  1227. // orderConfirm(that.cartId, that.news, addressId, shippingType, storeid, that.couponId).then(res => {
  1228. // if (res.data.upgrade_addr == 1) {
  1229. // that.id = res.data.addressInfo.id
  1230. // this.isaddress = true
  1231. // }
  1232. // if (numType != 1) {
  1233. // let confirm = this.objToArr(res.data.custom_form);
  1234. // confirm.forEach((item, index, arr) => {
  1235. // CACHE_CITY[index] = ''; //清空省市区
  1236. // if (item.name == 'texts') {
  1237. // if (item.defaultValConfig.value) {
  1238. // item.value = item.defaultValConfig.value
  1239. // } else {
  1240. // item.value = ''
  1241. // }
  1242. // } else if (item.name == 'radios') {
  1243. // item.value = item.wordsConfig.list[0].val
  1244. // } else if (item.name == 'uploadPicture') {
  1245. // item.value = [];
  1246. // } else if (item.name == 'dateranges') {
  1247. // if (item.valConfig.tabVal == 0) {
  1248. // if (item.valConfig.tabData == 0) {
  1249. // let obj = dayjs(new Date(Number(new Date().getTime()))).format(
  1250. // 'YYYY-MM-DD');
  1251. // item.value = [obj, obj]
  1252. // } else {
  1253. // let data1 = dayjs(new Date(Number(new Date(item.valConfig
  1254. // .specifyDate[0]).getTime()))).format('YYYY-MM-DD');
  1255. // let data2 = dayjs(new Date(Number(new Date(item.valConfig
  1256. // .specifyDate[1]).getTime()))).format('YYYY-MM-DD');
  1257. // item.value = [data1, data2];
  1258. // }
  1259. // } else {
  1260. // item.value = [];
  1261. // }
  1262. // } else {
  1263. // if (['times', 'dates', 'timeranges'].indexOf(item.name) != -1) {
  1264. // if (item.valConfig.tabVal == 0) {
  1265. // if (item.valConfig.tabData == 0) {
  1266. // if (item.name == 'times') {
  1267. // item.value = dayjs(new Date(Number(new Date()
  1268. // .getTime()))).format('HH:mm');
  1269. // } else if (item.name == 'dates') {
  1270. // item.value = dayjs(new Date(Number(new Date()
  1271. // .getTime()))).format('YYYY-MM-DD');
  1272. // } else {
  1273. // let current = dayjs(new Date(Number(new Date()
  1274. // .getTime()))).format('HH:mm');
  1275. // item.value = current + ' - ' + current;
  1276. // }
  1277. // } else {
  1278. // if (item.name == 'times' || item.name == 'dates') {
  1279. // item.value = item.valConfig.specifyDate;
  1280. // } else {
  1281. // item.value = item.valConfig.specifyDate[0] + ' - ' +
  1282. // item.valConfig.specifyDate[1];
  1283. // }
  1284. // }
  1285. // } else {
  1286. // item.value = '';
  1287. // }
  1288. // } else {
  1289. // item.value = '';
  1290. // }
  1291. // }
  1292. // })
  1293. // function sortNumber(a, b) {
  1294. // return a.timestamp - b.timestamp;
  1295. // }
  1296. // confirm.sort(sortNumber);
  1297. // that.$set(that, 'confirm', confirm);
  1298. // }
  1299. // that.$set(that, 'goodsType', res.data.type);
  1300. // that.$set(that, 'userInfo', res.data.userInfo);
  1301. // that.$set(that, 'integral', res.data.userInfo.integral);
  1302. // that.$set(that, 'contacts', res.data.userInfo.real_name);
  1303. // that.$set(that, 'contactsTel', res.data.userInfo.record_phone || '');
  1304. // that.$set(that, 'integralRatio', res.data.integralRatio);
  1305. // that.$set(that, 'offlinePostage', res.data.offlinePostage);
  1306. // that.$set(that, 'orderKey', res.data.orderKey);
  1307. // that.$set(that, 'valid_count', res.data.valid_count);
  1308. // that.$set(that, 'discount_id', res.data.discount_id)
  1309. // that.$set(that, 'priceGroup', res.data.priceGroup);
  1310. // that.$set(that, 'seckillId', parseInt(res.data.seckill_id));
  1311. // that.$set(that, 'BargainId', parseInt(res.data.bargain_id));
  1312. // that.$set(that, 'combinationId', parseInt(res.data.combination_id));
  1313. // that.$set(that, 'discountId', parseInt(res.data.discount_id));
  1314. // that.$set(that, 'invoice_func', res.data.invoice_func);
  1315. // that.$set(that, 'special_invoice', res.data.special_invoice);
  1316. // that.$set(that, 'integral_ratio_status', res.data.integral_ratio_status);
  1317. // that.$set(that, 'store_self_mention', res.data.store_self_mention);
  1318. // that.$set(that, 'store_func_status', res.data.store_func_status);
  1319. // that.giveData.give_integral = res.data.give_integral;
  1320. // that.giveData.give_coupon = res.data.give_coupon;
  1321. // let cartInfo = res.data.cartInfo;
  1322. // let cartObj = [],
  1323. // giftObj = [];
  1324. // cartInfo.forEach(item => {
  1325. // if (item.is_gift == 1) {
  1326. // giftObj.push(item)
  1327. // } else {
  1328. // cartObj.push(item)
  1329. // }
  1330. // })
  1331. // that.$set(that, 'cartInfo', cartObj);
  1332. // that.$set(that, 'giveCartInfo', giftObj);
  1333. // let giveType = -1;
  1334. // giftObj.forEach(item => {
  1335. // if (item.product_type == 0 || item.product_type == 4) {
  1336. // return giveType = 0
  1337. // }
  1338. // })
  1339. // that.$set(that, 'product_type', (res.data.product_type == 0 || giveType == 0 || res.data
  1340. // .product_type == 4) ? 0 : 1);
  1341. // //微信支付是否开启
  1342. // that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
  1343. // //支付宝是否开启
  1344. // that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
  1345. // //#ifdef MP
  1346. // that.cartArr[1].payStatus = 0;
  1347. // //#endif
  1348. // //余额支付是否开启
  1349. // // that.cartArr[2].title = '可用余额:' + res.data.userInfo.now_money;
  1350. // that.cartArr[2].number = res.data.userInfo.now_money;
  1351. // that.cartArr[2].payStatus = res.data.yue_pay_status == 1 ? res.data.yue_pay_status : 0
  1352. // if (res.data.offline_pay_status == 2) {
  1353. // that.cartArr[3].payStatus = 0
  1354. // } else {
  1355. // that.cartArr[3].payStatus = 1
  1356. // }
  1357. // // that.$set(that, 'cartArr', that.cartArr);
  1358. // that.$set(that, 'ChangePrice', that.totalPrice);
  1359. // that.getBargainId();
  1360. // that.getCouponList();
  1361. // that.computedPrice();
  1362. // if (this.addressId || this.couponId) {
  1363. // // this.computedPrice();
  1364. // } else {
  1365. // that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup
  1366. // .totalPrice),
  1367. // parseFloat(res.data
  1368. // .priceGroup.storePostage)));
  1369. // }
  1370. // }).catch(err => {
  1371. // return this.$util.Tips({
  1372. // title: err
  1373. // });
  1374. // });
  1375. },
  1376. /*
  1377. * 提取砍价和拼团id
  1378. */
  1379. getBargainId: function() {
  1380. let that = this;
  1381. // let cartINfo = that.cartInfo;
  1382. // let BargainId = 0;
  1383. // let combinationId = 0;
  1384. // let discountId = 0;
  1385. // cartINfo.forEach(function(value, index, cartINfo) {
  1386. // BargainId = cartINfo[index].bargain_id,
  1387. // combinationId = cartINfo[index].combination_id,
  1388. // discountId = cartINfo[index].discount_id
  1389. // })
  1390. // that.$set(that, 'BargainId', parseInt(BargainId));
  1391. // that.$set(that, 'combinationId', parseInt(combinationId));
  1392. // that.$set(that, 'discountId', parseInt(discountId));
  1393. if (that.cartArr.length == 3 && (that.BargainId || that.combinationId || that.seckillId || that
  1394. .discountId)) {
  1395. that.cartArr[2].payStatus = 0;
  1396. that.$set(that, 'cartArr', that.cartArr);
  1397. }
  1398. },
  1399. /**
  1400. * 获取当前金额可用优惠券
  1401. *
  1402. */
  1403. getCouponList: function() {
  1404. let that = this;
  1405. let data = {
  1406. cartId: this.cartId,
  1407. 'new': this.news,
  1408. shipping_type: that.$util.$h.Add(that.shippingType, 1),
  1409. store_id: that.system_store ? that.system_store.id : 0
  1410. }
  1411. getCouponsOrderPrice(this.totalPrice, data).then(res => {
  1412. that.$set(that.coupon, 'list', res.data);
  1413. that.openType = 1;
  1414. });
  1415. },
  1416. /*
  1417. * 获取默认收货地址或者获取某条地址信息
  1418. */
  1419. getaddressInfo: function() {
  1420. let that = this;
  1421. if (that.addressId) {
  1422. getAddressDetail(that.addressId).then(res => {
  1423. res.data.is_default = parseInt(res.data.is_default);
  1424. that.addressInfo = res.data || {};
  1425. that.addressId = res.data.id || 0;
  1426. that.address.addressId = res.data.id || 0;
  1427. })
  1428. } else {
  1429. getAddressDefault().then(res => {
  1430. res.data.is_default = parseInt(res.data.is_default);
  1431. that.addressInfo = res.data || {};
  1432. that.addressId = res.data.id || 0;
  1433. that.address.addressId = res.data.id || 0;
  1434. })
  1435. }
  1436. },
  1437. payItem: function(e) {
  1438. let that = this;
  1439. let active = e;
  1440. that.active = active;
  1441. that.animated = true;
  1442. that.payType = that.cartArr[active].value;
  1443. that.computedPrice();
  1444. setTimeout(function() {
  1445. that.car();
  1446. }, 500);
  1447. },
  1448. couponTap: function() {
  1449. this.coupon.coupon = true;
  1450. this.coupon.list.forEach((item, index) => {
  1451. if (item.id == this.couponId) {
  1452. item.is_use = 1
  1453. } else {
  1454. item.is_use = 0
  1455. }
  1456. })
  1457. this.$set(this.coupon, 'list', this.coupon.list);
  1458. },
  1459. car: function() {
  1460. let that = this;
  1461. that.animated = false;
  1462. },
  1463. onAddress: function(name) {
  1464. let that = this;
  1465. if (name) {
  1466. that.textareaStatus = false;
  1467. that.address.address = true;
  1468. that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this
  1469. .cartId +
  1470. '&pinkId=' +
  1471. this.pinkId +
  1472. '&couponId=' +
  1473. this.couponId + '&delivery_type=' + this.deliveryType + '&addressId=' + this.addressId +
  1474. '&store_id=' + this.storeId + '&store_name=' + this.system_store.name + '&product_id=' + this
  1475. .product_id
  1476. } else {
  1477. uni.navigateTo({
  1478. url: '/pages/users/user_address/index?new=' + this.news + '&cartId=' + this.cartId +
  1479. '&pinkId=' +
  1480. this.pinkId +
  1481. '&couponId=' +
  1482. this.couponId + '&delivery_type=' + this.deliveryType + '&addressId=' + this
  1483. .addressId + '&store_id=' + this.storeId + '&store_name=' + this.system_store
  1484. .name + '&product_id=' + this.product_id
  1485. })
  1486. }
  1487. },
  1488. payment: function(data) {
  1489. let that = this;
  1490. orderCreate(that.orderKey, data).then(res => {
  1491. let status = res.data.status,
  1492. orderId = res.data.result.orderId,
  1493. jsConfig = res.data.result.jsConfig,
  1494. goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + res
  1495. .msg +
  1496. '&type=3' + '&totalPrice=' + this.totalPrice
  1497. switch (status) {
  1498. case 'ORDER_EXIST':
  1499. case 'EXTEND_ORDER':
  1500. case 'PAY_ERROR':
  1501. uni.hideLoading();
  1502. return that.$util.Tips({
  1503. title: res.msg
  1504. }, {
  1505. tab: 5,
  1506. url: goPages
  1507. });
  1508. break;
  1509. case 'SUCCESS':
  1510. uni.hideLoading();
  1511. if (that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
  1512. .discountId)
  1513. return that.$util.Tips({
  1514. title: res.msg,
  1515. icon: 'success'
  1516. }, {
  1517. tab: 4,
  1518. url: goPages
  1519. });
  1520. return that.$util.Tips({
  1521. title: res.msg,
  1522. icon: 'success'
  1523. }, {
  1524. tab: 5,
  1525. url: goPages
  1526. });
  1527. break;
  1528. case 'WECHAT_PAY':
  1529. that.toPay = true;
  1530. // #ifdef MP
  1531. /* that.toPay = true; */
  1532. let mp_pay_name = ''
  1533. if (uni.requestOrderPayment) {
  1534. mp_pay_name = 'requestOrderPayment'
  1535. } else {
  1536. mp_pay_name = 'requestPayment'
  1537. }
  1538. uni[mp_pay_name]({
  1539. timeStamp: jsConfig.timestamp,
  1540. nonceStr: jsConfig.nonceStr,
  1541. package: jsConfig.package,
  1542. signType: jsConfig.signType,
  1543. paySign: jsConfig.paySign,
  1544. success: function(res) {
  1545. uni.hideLoading();
  1546. if (that.BargainId || that.combinationId || that.pinkId || that
  1547. .seckillId || that.discountId)
  1548. return that.$util.Tips({
  1549. title: '支付成功',
  1550. icon: 'success'
  1551. }, {
  1552. tab: 4,
  1553. url: goPages
  1554. });
  1555. return that.$util.Tips({
  1556. title: '支付成功',
  1557. icon: 'success'
  1558. }, {
  1559. tab: 5,
  1560. url: goPages
  1561. });
  1562. },
  1563. fail: function(e) {
  1564. uni.hideLoading();
  1565. return that.$util.Tips({
  1566. title: '取消支付'
  1567. }, {
  1568. tab: 5,
  1569. url: goPages + '&status=2'
  1570. });
  1571. },
  1572. complete: function(e) {
  1573. uni.hideLoading();
  1574. //关闭当前页面跳转至订单状态
  1575. if (res.errMsg == 'requestPayment:cancel') return that.$util
  1576. .Tips({
  1577. title: '取消支付'
  1578. }, {
  1579. tab: 5,
  1580. url: goPages + '&status=2'
  1581. });
  1582. },
  1583. })
  1584. // #endif
  1585. // #ifdef H5
  1586. this.$wechat.pay(res.data.result.jsConfig).then(res => {
  1587. return that.$util.Tips({
  1588. title: '支付成功',
  1589. icon: 'success'
  1590. }, {
  1591. tab: 5,
  1592. url: goPages
  1593. });
  1594. }).catch(res => {
  1595. if (!this.$wechat.isWeixin()) {
  1596. uni.redirectTo({
  1597. url: goPages +
  1598. '&msg=支付失败&status=2'
  1599. })
  1600. }
  1601. if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
  1602. title: '取消支付'
  1603. }, {
  1604. tab: 5,
  1605. url: goPages + '&status=2'
  1606. });
  1607. })
  1608. // #endif
  1609. // #ifdef APP-PLUS
  1610. uni.requestPayment({
  1611. provider: 'wxpay',
  1612. orderInfo: jsConfig,
  1613. success: (e) => {
  1614. let url = goPages;
  1615. uni.showToast({
  1616. title: "支付成功"
  1617. })
  1618. setTimeout(res => {
  1619. uni.redirectTo({
  1620. url: url
  1621. })
  1622. }, 2000)
  1623. },
  1624. fail: (e) => {
  1625. let url = '/pages/goods/order_pay_status/index?order_id=' +
  1626. orderId +
  1627. '&msg=支付失败';
  1628. uni.showModal({
  1629. content: "支付失败",
  1630. showCancel: false,
  1631. success: function(res) {
  1632. if (res.confirm) {
  1633. uni.redirectTo({
  1634. url: url
  1635. })
  1636. } else if (res.cancel) {
  1637. console.log('用户点击取消');
  1638. }
  1639. }
  1640. })
  1641. },
  1642. complete: () => {
  1643. uni.hideLoading();
  1644. },
  1645. });
  1646. // #endif
  1647. break;
  1648. case 'PAY_DEFICIENCY':
  1649. uni.hideLoading();
  1650. //余额不足
  1651. return that.$util.Tips({
  1652. title: res.msg
  1653. }, {
  1654. tab: 5,
  1655. url: goPages + '&status=1'
  1656. });
  1657. break;
  1658. case "WECHAT_H5_PAY":
  1659. uni.hideLoading();
  1660. that.$util.Tips({
  1661. title: '订单创建成功!'
  1662. }, {
  1663. tab: 4,
  1664. url: goPages + '&status=0'
  1665. });
  1666. setTimeout(() => {
  1667. location.href = res.data.result.jsConfig.mweb_url;
  1668. }, 2000);
  1669. break;
  1670. case 'ALIPAY_PAY':
  1671. //#ifdef H5
  1672. if (this.from === 'weixin') {
  1673. uni.redirectTo({
  1674. url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
  1675. });
  1676. } else {
  1677. uni.hideLoading();
  1678. that.formContent = res.data.result.jsConfig;
  1679. that.$nextTick(() => {
  1680. document.getElementById('alipaysubmit').submit();
  1681. })
  1682. }
  1683. //#endif
  1684. // #ifdef MP
  1685. uni.navigateTo({
  1686. url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
  1687. });
  1688. // #endif
  1689. // #ifdef APP-PLUS
  1690. uni.requestPayment({
  1691. provider: 'alipay',
  1692. orderInfo: jsConfig,
  1693. success: (e) => {
  1694. uni.showToast({
  1695. title: "支付成功"
  1696. })
  1697. let url = '/pages/goods/order_pay_status/index?order_id=' +
  1698. orderId +
  1699. '&msg=支付成功';
  1700. setTimeout(res => {
  1701. uni.redirectTo({
  1702. url: url
  1703. })
  1704. }, 2000)
  1705. },
  1706. fail: (e) => {
  1707. let url = '/pages/goods/order_pay_status/index?order_id=' +
  1708. orderId +
  1709. '&msg=支付失败';
  1710. uni.showModal({
  1711. content: "支付失败",
  1712. showCancel: false,
  1713. success: function(res) {
  1714. if (res.confirm) {
  1715. uni.redirectTo({
  1716. url: url
  1717. })
  1718. } else if (res.cancel) {
  1719. console.log('用户点击取消');
  1720. }
  1721. }
  1722. })
  1723. },
  1724. complete: () => {
  1725. uni.hideLoading();
  1726. },
  1727. });
  1728. // #endif
  1729. break;
  1730. }
  1731. }).catch(err => {
  1732. uni.hideLoading();
  1733. return that.$util.Tips({
  1734. title: err
  1735. });
  1736. });
  1737. },
  1738. clickTextArea() {
  1739. this.$refs.textarea.focus()
  1740. },
  1741. bindDateChange: function(e, index) {
  1742. this.confirm[index].value = e.target.value
  1743. },
  1744. bindTimeChange: function(e, index) {
  1745. this.confirm[index].value = e.target.value
  1746. },
  1747. bindSelectChange: function(e, index, item) {
  1748. this.confirm[index].value = item.wordsConfig.list[e.detail.value].val
  1749. },
  1750. getTimeranges(index) {
  1751. this.isShow = true
  1752. this.timerangesIndex = index
  1753. },
  1754. confrim(e) {
  1755. this.isShow = false;
  1756. this.confirm[this.timerangesIndex].value = e.time;
  1757. let arrayNew = [];
  1758. e.val.forEach(item => {
  1759. arrayNew.push(Number(item))
  1760. })
  1761. this.timeranges = arrayNew;
  1762. },
  1763. cancels() {
  1764. this.isShow = false;
  1765. },
  1766. // 单选
  1767. radioChange(e, index, item) {
  1768. this.confirm[index].value = item.wordsConfig.list[e.detail.value].val
  1769. },
  1770. // 多选
  1771. checkboxChange(e, index, item) {
  1772. let obj = e.detail.value;
  1773. let val = '';
  1774. item.wordsConfig.list.forEach((j, jindex) => {
  1775. obj.forEach(x => {
  1776. if (jindex == x) {
  1777. val = val + (val ? ',' : '') + j.val;
  1778. }
  1779. })
  1780. })
  1781. this.confirm[index].value = val
  1782. },
  1783. formVerify() {
  1784. this.pay_close = true;
  1785. },
  1786. SubOrder: function(e) {
  1787. let that = this,
  1788. data = {};
  1789. if (!that.payType) return that.$util.Tips({
  1790. title: '请选择支付方式'
  1791. });
  1792. data = {
  1793. collate_code_id: that.collage_id || that.tableId,
  1794. custom_form: that.confirm,
  1795. real_name: that.contacts,
  1796. phone: that.contactsTel,
  1797. addressId: that.addressId,
  1798. formId: '',
  1799. couponId: that.priceGroup.couponPrice == 0 ? 0 : that.couponId,
  1800. payType: that.payType,
  1801. useIntegral: that.useIntegral,
  1802. bargainId: that.BargainId,
  1803. combinationId: that.combinationId,
  1804. discountId: that.discountId,
  1805. pinkId: that.pinkId,
  1806. seckill_id: that.seckillId,
  1807. mark: that.mark,
  1808. store_id: that.ptype == 6 ? that.system_store.id : (that.deliveryType == 1 ? 0 : that.system_store.id || 0),
  1809. 'from': that.from,
  1810. shipping_type: that.tableId ? 4 : that.$util.$h.Add(that.shippingType, 1),
  1811. 'new': that.news,
  1812. 'invoice_id': that.invChecked,
  1813. // #ifdef H5
  1814. quitUrl: location.protocol + '//' + location.hostname +
  1815. '/pages/goods/order_pay_status/index?' +
  1816. '&type=3' + '&totalPrice=' + this.totalPrice
  1817. // #endif
  1818. // #ifdef APP-PLUS
  1819. quitUrl: '/pages/goods/order_details/index?order_id=' + this.order_id
  1820. // #endif
  1821. };
  1822. if (data.payType == 'yue' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
  1823. return that.$util.Tips({
  1824. title: '余额不足!'
  1825. });
  1826. uni.showLoading({
  1827. title: '订单支付中'
  1828. });
  1829. // #ifdef MP
  1830. openPaySubscribe().then(() => {
  1831. that.payment(data);
  1832. });
  1833. // #endif
  1834. // #ifndef MP
  1835. that.payment(data);
  1836. // #endif
  1837. }
  1838. }
  1839. }
  1840. </script>
  1841. <style lang="scss" scoped>
  1842. /deep/.uni-date-x--border {
  1843. border: 0;
  1844. }
  1845. /deep/.uni-icons {
  1846. font-size: 0 !important;
  1847. }
  1848. /deep/.uni-date-x {
  1849. color: #999;
  1850. font-size: 15px;
  1851. }
  1852. /deep/.uni-date__x-input {
  1853. font-size: 15px;
  1854. }
  1855. .height-add {
  1856. height: calc(120rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1857. height: calc(120rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1858. }
  1859. /deep/uni-checkbox[disabled] .uni-checkbox-input {
  1860. background-color: #eee;
  1861. }
  1862. .confirmImg {
  1863. width: 100%;
  1864. }
  1865. /deep/.orderGoods {
  1866. margin-top: 20rpx;
  1867. border-radius: 14rpx;
  1868. }
  1869. .confirmImg .upload {
  1870. padding-bottom: 36rpx;
  1871. }
  1872. .confirmImg .upload .pictrue {
  1873. margin: 22rpx 23rpx 0 0;
  1874. width: 146rpx;
  1875. height: 146rpx;
  1876. position: relative;
  1877. font-size: 24rpx;
  1878. color: #bbb;
  1879. }
  1880. .confirmImg .upload .pictrue:nth-of-type(4n) {
  1881. margin-right: 0;
  1882. }
  1883. .confirmImg .upload .pictrue image {
  1884. width: 100%;
  1885. height: 100%;
  1886. border-radius: 8rpx;
  1887. }
  1888. .confirmImg .upload .pictrue .icon-guanbi1 {
  1889. position: absolute;
  1890. font-size: 45rpx;
  1891. top: -10rpx;
  1892. right: -10rpx;
  1893. }
  1894. .confirmImg .upload .pictrue .close {
  1895. position: absolute;
  1896. width: 26rpx;
  1897. height: 26rpx;
  1898. border-radius: 0 8rpx 0 8rpx;
  1899. background-color: rgba(0, 0, 0, 0.6);
  1900. top: 0;
  1901. right: 0;
  1902. }
  1903. .confirmImg .upload .pictrue .close .iconfont {
  1904. font-size: 24rpx;
  1905. }
  1906. .confirmImg .upload .pictrue .icon-icon25201 {
  1907. color: #bfbfbf;
  1908. font-size: 50rpx;
  1909. }
  1910. .confirmImg .upload .pictrue:nth-last-child(1) {
  1911. border: 1rpx solid #ddd;
  1912. box-sizing: border-box;
  1913. }
  1914. .alipaysubmit {
  1915. display: none;
  1916. }
  1917. .order-submission .line {
  1918. width: 100%;
  1919. height: 4rpx;
  1920. }
  1921. .order-submission .line image {
  1922. width: 100%;
  1923. height: 100%;
  1924. display: block;
  1925. }
  1926. .order-submission .headerCon {
  1927. background-color: #fff;
  1928. box-sizing: border-box;
  1929. .icon-s-bianji {
  1930. width: 44rpx;
  1931. height: 44rpx;
  1932. background: #F5F5F5;
  1933. border-radius: 50%;
  1934. text-align: center;
  1935. line-height: 44rpx;
  1936. font-size: 17rpx;
  1937. color: #666;
  1938. }
  1939. .add-title {
  1940. height: 72rpx;
  1941. padding: 0 26rpx;
  1942. border-bottom: 1px solid #eee;
  1943. .icon {
  1944. height: 32rpx;
  1945. background: #1890FF;
  1946. border-radius: 4rpx;
  1947. font-size: 20rpx;
  1948. font-weight: 400;
  1949. color: #FFFFFF;
  1950. text-align: center;
  1951. line-height: 32rpx;
  1952. padding: 0 6rpx;
  1953. &.orange {
  1954. background: #FE960F;
  1955. }
  1956. &.red {
  1957. background: #E93323;
  1958. }
  1959. }
  1960. .add-text {
  1961. margin-left: 14rpx;
  1962. width: 360rpx;
  1963. }
  1964. .text {
  1965. font-size: 24rpx;
  1966. font-weight: 400;
  1967. color: #999999;
  1968. .icon-jiantou {
  1969. display: inline-block;
  1970. font-size: 20rpx;
  1971. }
  1972. }
  1973. }
  1974. }
  1975. .order-submission .address {
  1976. padding: 0 26rpx;
  1977. height: 130rpx;
  1978. .icon {
  1979. .iconfont {
  1980. width: 44rpx;
  1981. height: 44rpx;
  1982. background: var(--view-minorColorT);
  1983. font-size: 20rpx;
  1984. border-radius: 50%;
  1985. text-align: center;
  1986. line-height: 44rpx;
  1987. color: var(--view-theme);
  1988. margin-left: 26rpx;
  1989. }
  1990. }
  1991. }
  1992. .order-submission .address .addressCon {
  1993. width: 502rpx;
  1994. font-size: 26rpx;
  1995. color: #666;
  1996. }
  1997. .order-submission .address .addressCon .name {
  1998. font-size: 30rpx;
  1999. color: #282828;
  2000. font-weight: bold;
  2001. margin-bottom: 10rpx;
  2002. .nameCon {
  2003. max-width: 244rpx;
  2004. &.on {
  2005. max-width: unset;
  2006. }
  2007. }
  2008. }
  2009. .order-submission .address .addressCon .name .phone {
  2010. margin-left: 50rpx;
  2011. }
  2012. .order-submission .address .addressCon .default {
  2013. margin-right: 12rpx;
  2014. }
  2015. .order-submission .address .addressCon .setaddress {
  2016. color: #333;
  2017. font-size: 28rpx;
  2018. }
  2019. .order-submission .allAddress {
  2020. width: 100%;
  2021. background: linear-gradient(to bottom, var(--view-theme) 0%, #f5f5f5 100%);
  2022. display: flex;
  2023. flex-direction: column;
  2024. justify-content: center;
  2025. align-items: center;
  2026. padding-top: 24rpx;
  2027. }
  2028. .order-submission .allAddress .nav {
  2029. width: 710rpx;
  2030. // margin: 0 auto;
  2031. }
  2032. .order-submission .allAddress .nav .item {
  2033. width: 355rpx;
  2034. }
  2035. .order-submission .allAddress .nav .item.on {
  2036. position: relative;
  2037. width: 250rpx;
  2038. }
  2039. .order-submission .allAddress .nav .item.on::before {
  2040. position: absolute;
  2041. bottom: 0;
  2042. content: "快递配送";
  2043. font-size: 28rpx;
  2044. display: block;
  2045. height: 0;
  2046. width: 336rpx;
  2047. border-width: 0 20rpx 80rpx 0;
  2048. border-style: none solid solid;
  2049. border-color: transparent transparent #fff;
  2050. z-index: 2;
  2051. border-radius: 7rpx 30rpx 0 0;
  2052. text-align: center;
  2053. // line-height: 80rpx;
  2054. }
  2055. .header-title {
  2056. font-size: 36rpx;
  2057. font-weight: 600;
  2058. color: #FFFFFF;
  2059. }
  2060. .order-submission .allAddress .nav .item:nth-of-type(2).on::before {
  2061. content: "到店自提";
  2062. border-width: 0 0 80rpx 20rpx;
  2063. border-radius: 30rpx 7rpx 0 0;
  2064. }
  2065. .order-submission .allAddress .nav .item.on2 {
  2066. position: relative;
  2067. }
  2068. .order-submission .allAddress .nav .item.on2::before {
  2069. position: absolute;
  2070. bottom: 0;
  2071. content: "到店自提";
  2072. font-size: 28rpx;
  2073. display: block;
  2074. height: 0;
  2075. width: 400rpx;
  2076. border-width: 0 0 60rpx 60rpx;
  2077. border-style: none solid solid;
  2078. border-color: transparent transparent rgba(255, 255, 255, 0.6);
  2079. border-radius: 40rpx 6rpx 0 0;
  2080. text-align: center;
  2081. // line-height: 60rpx;
  2082. }
  2083. .order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
  2084. content: "快递配送";
  2085. border-width: 0 60rpx 60rpx 0;
  2086. border-radius: 6rpx 40rpx 0 0;
  2087. }
  2088. .order-submission .allAddress .headerCon {
  2089. width: 710rpx;
  2090. margin: 0 auto;
  2091. border-radius: 14rpx;
  2092. background-color: #fff;
  2093. }
  2094. .order-submission .allAddress .line {
  2095. width: 710rpx;
  2096. margin: 0 auto;
  2097. }
  2098. .order-submission .wrapper .item .discount .placeholder {
  2099. color: #ccc;
  2100. }
  2101. .placeholder-textarea {
  2102. position: relative;
  2103. .placeholder {
  2104. position: absolute;
  2105. color: #ccc;
  2106. top: 26rpx;
  2107. left: 30rpx;
  2108. }
  2109. }
  2110. .order-submission .wrapper {
  2111. background-color: #fff;
  2112. width: 710rpx;
  2113. border-radius: 14rpx;
  2114. margin: 0 auto;
  2115. margin-top: 14rpx;
  2116. }
  2117. .order-submission .wrapper .item .name {
  2118. position: relative;
  2119. width: 190rpx;
  2120. }
  2121. .order-submission .wrapper .item .asterisk {
  2122. position: absolute;
  2123. color: red;
  2124. left: -15rpx
  2125. }
  2126. .order-submission .wrapper .item {
  2127. padding: 27rpx 30rpx;
  2128. font-size: 30rpx;
  2129. color: #282828;
  2130. border-bottom: 1px solid #f0f0f0;
  2131. }
  2132. .order-submission .wrapper .item.on {
  2133. padding: 17rpx 14rpx 17rpx 30rpx;
  2134. align-items: baseline;
  2135. }
  2136. .order-submission .wrapper .item.on3 {
  2137. align-items: baseline;
  2138. }
  2139. .order-submission .wrapper .item.on2 {
  2140. padding: 17rpx 30rpx;
  2141. }
  2142. .order-submission .wrapper .item .discount {
  2143. font-size: 30rpx;
  2144. color: #999;
  2145. }
  2146. .order-submission .wrapper .item.on .discount,
  2147. .order-submission .wrapper .item.on3 .discount {
  2148. width: 460rpx;
  2149. text-align: right;
  2150. }
  2151. .order-submission .wrapper .item.on3 .discount .city {
  2152. width: 400rpx;
  2153. }
  2154. .order-submission .wrapper .item .discount input {
  2155. text-align: right;
  2156. width: 450rpx;
  2157. }
  2158. .order-submission .wrapper .item .discount .iconfont {
  2159. color: #515151;
  2160. font-size: 30rpx;
  2161. margin-left: 15rpx;
  2162. }
  2163. .order-submission .wrapper .item .discount .num {
  2164. font-size: 32rpx;
  2165. margin-right: 20rpx;
  2166. }
  2167. .order-submission .wrapper .item .discount .radio {
  2168. margin: 0 22rpx 0 22rpx;
  2169. padding: 10rpx 0;
  2170. }
  2171. .order-submission .wrapper .item .discount .radio /deep/uni-checkbox .uni-checkbox-input {
  2172. border-radius: 0
  2173. }
  2174. .order-submission .wrapper .item .shipping {
  2175. font-size: 30rpx;
  2176. color: #999;
  2177. position: relative;
  2178. padding-right: 58rpx;
  2179. }
  2180. .order-submission .wrapper .item .shipping .iconfont {
  2181. font-size: 35rpx;
  2182. color: #707070;
  2183. position: absolute;
  2184. right: 0;
  2185. top: 50%;
  2186. transform: translateY(-50%);
  2187. margin-left: 30rpx;
  2188. }
  2189. .order-submission .wrapper .item textarea {
  2190. background-color: #f9f9f9;
  2191. width: 650rpx;
  2192. height: 140rpx;
  2193. border-radius: 3rpx;
  2194. margin-top: 30rpx;
  2195. padding: 25rpx 28rpx;
  2196. box-sizing: border-box;
  2197. }
  2198. .order-submission .wrapper .item .placeholder {
  2199. color: #ccc;
  2200. }
  2201. .order-submission .wrapper .item .list {
  2202. margin-top: 35rpx;
  2203. }
  2204. .order-submission .wrapper .item .list .payItem {
  2205. border: 1px solid #eee;
  2206. border-radius: 6rpx;
  2207. height: 86rpx;
  2208. width: 100%;
  2209. box-sizing: border-box;
  2210. margin-top: 20rpx;
  2211. font-size: 28rpx;
  2212. color: #282828;
  2213. }
  2214. .order-submission .wrapper .item .list .payItem.on {
  2215. border-color: #fc5445;
  2216. color: #e93323;
  2217. }
  2218. .order-submission .wrapper .item .list .payItem .name {
  2219. width: 50%;
  2220. text-align: center;
  2221. border-right: 1px solid #eee;
  2222. padding-left: 80rpx;
  2223. }
  2224. .order-submission .wrapper .item .list .payItem .name .iconfont {
  2225. width: 44rpx;
  2226. height: 44rpx;
  2227. border-radius: 50%;
  2228. text-align: center;
  2229. line-height: 44rpx;
  2230. background-color: #fe960f;
  2231. color: #fff;
  2232. font-size: 30rpx;
  2233. margin-right: 15rpx;
  2234. }
  2235. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
  2236. background-color: #41b035;
  2237. }
  2238. .order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
  2239. background-color: #1677FF;
  2240. }
  2241. .order-submission .wrapper .item .list .payItem .tip {
  2242. width: 49%;
  2243. text-align: center;
  2244. font-size: 26rpx;
  2245. color: #aaa;
  2246. }
  2247. .order-submission .moneyList {
  2248. background-color: #fff;
  2249. padding: 30rpx;
  2250. width: 710rpx;
  2251. border-radius: 14rpx;
  2252. margin: 0 auto;
  2253. margin-top: 14rpx;
  2254. }
  2255. .order-submission .moneyList .item {
  2256. font-size: 28rpx;
  2257. color: #282828;
  2258. }
  2259. .order-submission .moneyList .item~.item {
  2260. margin-top: 20rpx;
  2261. }
  2262. .order-submission .moneyList .item .money {
  2263. color: #868686;
  2264. }
  2265. .order-submission .footer {
  2266. width: 100%;
  2267. height: 100rpx;
  2268. background-color: #fff;
  2269. padding: 0 30rpx;
  2270. font-size: 28rpx;
  2271. color: #333;
  2272. box-sizing: border-box;
  2273. position: fixed;
  2274. bottom: 0;
  2275. left: 0;
  2276. z-index: 9;
  2277. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  2278. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  2279. padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  2280. padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  2281. }
  2282. .order-submission .footer .settlement {
  2283. font-size: 30rpx;
  2284. color: #fff;
  2285. width: 240rpx;
  2286. height: 70rpx;
  2287. background-color: var(--view-theme);
  2288. border-radius: 50rpx;
  2289. text-align: center;
  2290. line-height: 70rpx;
  2291. }
  2292. .footer .transparent {
  2293. opacity: 0
  2294. }
  2295. .tipaddress {
  2296. position: fixed;
  2297. left: 13%;
  2298. top: 25%;
  2299. // margin-left: -283rpx;
  2300. width: 560rpx;
  2301. height: 614rpx;
  2302. background-color: #fff;
  2303. border-radius: 10rpx;
  2304. z-index: 100;
  2305. text-align: center;
  2306. .top {
  2307. width: 560rpx;
  2308. height: 270rpx;
  2309. border-top-left-radius: 10rpx;
  2310. border-top-right-radius: 10rpx;
  2311. background-image: url(../../../static/images/address.png);
  2312. background-repeat: round;
  2313. background-color: var(--view-theme);
  2314. .tipsphoto {
  2315. display: inline-block;
  2316. width: 200rpx;
  2317. height: 200rpx;
  2318. margin-top: 73rpx;
  2319. }
  2320. }
  2321. .bottom {
  2322. font-size: 32rpx;
  2323. font-weight: 400;
  2324. .font1 {
  2325. font-size: 36rpx;
  2326. font-weight: 600;
  2327. color: #333333;
  2328. margin: 32rpx 0rpx 22rpx;
  2329. }
  2330. .font2 {
  2331. color: #666666;
  2332. margin-bottom: 48rpx;
  2333. }
  2334. .btn {
  2335. width: 360rpx;
  2336. height: 82rpx;
  2337. border-radius: 42rpx;
  2338. background: linear-gradient(to left, var(--view-theme) 0%, #f5f5f5 100%);
  2339. color: #FFFFFF;
  2340. line-height: 82rpx;
  2341. margin: 0 auto;
  2342. }
  2343. }
  2344. }
  2345. .mark {
  2346. position: fixed;
  2347. top: 0;
  2348. left: 0;
  2349. bottom: 0;
  2350. right: 0;
  2351. background: rgba(0, 0, 0, 0.5);
  2352. z-index: 99;
  2353. }
  2354. .table-header {
  2355. width: 710rpx;
  2356. padding: 52rpx 24rpx 46rpx;
  2357. border-radius: 14rpx;
  2358. margin: 0 30rpx;
  2359. background-color: #FFFFFF;
  2360. font-size: 24rpx;
  2361. color: #999999;
  2362. .top {
  2363. display: flex;
  2364. margin-bottom: 18rpx;
  2365. }
  2366. .name {
  2367. flex: 1;
  2368. min-width: 0;
  2369. font-weight: 600;
  2370. font-size: 34rpx;
  2371. color: #333333;
  2372. }
  2373. .number {
  2374. color: #333333;
  2375. }
  2376. .light {
  2377. margin-right: 6rpx;
  2378. font-weight: 600;
  2379. font-size: 34rpx;
  2380. color: var(--view-theme);
  2381. }
  2382. }
  2383. //指派
  2384. .zp-wrap {
  2385. margin-top: 20rpx;
  2386. width: 750rpx;
  2387. height: 216rpx;
  2388. white-space: nowrap;
  2389. .zp-item {
  2390. display: inline-block;
  2391. margin-right: 15rpx;
  2392. padding-top: 34rpx;
  2393. width: 172rpx;
  2394. height: 216rpx;
  2395. // background: #E02020;
  2396. background-color: #fff;
  2397. border-radius: 10rpx;
  2398. .zp-logo {
  2399. display: block;
  2400. width: 106rpx;
  2401. height: 106rpx;
  2402. margin: auto;
  2403. border-radius: 50%;
  2404. background-color: #eee;
  2405. }
  2406. .zp-name {
  2407. margin-top: 15rpx;
  2408. width: 100%;
  2409. text-align: center;
  2410. font-size: 30rpx;
  2411. font-weight: bold;
  2412. color: #333333;
  2413. }
  2414. }
  2415. .choose {
  2416. background-color: #262261 !important;
  2417. .zp-name {
  2418. color: #fff !important;
  2419. }
  2420. }
  2421. }
  2422. </style>