product-aftersale-2.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>售后换新-产品中心-创业帮</title>
  6. <meta name="keywords" content="售后换新-产品中心-创业帮">
  7. <meta name="description" content="售后换新-产品中心-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="售后换新-产品中心-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="bgc-back apply pb0 pt0" style="padding-top:0;">
  18. <div id="app">
  19. <van-nav-bar class="user_rank_explan_title user_title_normal rightc333" left-arrow title="售后换新" v-if="toptitleisshow" @click-left="goback" @click-right="applyrecord">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="deal-check" v-cloak style="padding-bottom:50px;">
  23. <van-cell-group class="deal-check1" :border="false">
  24. <van-card centered>
  25. <template #title>
  26. <van-cell-group :border="false">
  27. <van-cell class="machine-list machine-list1" value-class="f14 c999" center :border="false">
  28. <template #title>
  29. <div class="f14 c333"><span class="vm">SN:</span><span class="vm pr16">{{SNcode.SN}}</span></div>
  30. </template>
  31. </van-cell>
  32. </van-cell-group>
  33. </template>
  34. </van-card>
  35. </van-cell-group>
  36. <van-cell-group :border="false" title="发货仓库">
  37. <van-cell title="请选择离收货地址最近的仓库" :border="false" is-link center v-if="selectedWarehouseId === ''" @click="gowarehouse"></van-cell>
  38. <van-cell :border="false" is-link center v-if="selectedWarehouseId !== ''" @click="gowarehouse">
  39. <template #title>
  40. <div class="f14 c333">{{warehouse.StoreName}}(库存{{warehouse.LaveNum}}台)</div>
  41. </template>
  42. <template #label>
  43. <div class="f12 c999">联系人:{{warehouse.ManageName}}{{warehouse.ManageMobile}}</div>
  44. <div class="f12 c999">地址:{{warehouse.Areas}}{{warehouse.Address}}</div>
  45. </template>
  46. </van-cell>
  47. <van-cell title="提货方式" :border="false">
  48. <template #right-icon>
  49. <van-radio-group v-model="radio" direction="horizontal">
  50. <van-radio name="1">邮寄到付</van-radio>
  51. <van-radio name="2">上门自提</van-radio>
  52. </van-radio-group>
  53. </template>
  54. </van-cell>
  55. <van-field v-model="dealNote" name="订单备注" label="订单备注" placeholder="默认韵达快递,选择其他快递请备注" :rules="[{ required: true, message: '请填写用户名' }]"></van-field>
  56. </van-cell-group>
  57. <van-cell-group :border="false" title="收货信息">
  58. <van-cell title="请选择收货地址" :border="false" is-link v-if="selectedAddressId === '' &amp;&amp; radio === '1'" @click="goaddress"></van-cell>
  59. <van-cell title="请选择提货人信息" :border="false" is-link v-if="selectedAddressId === '' &amp;&amp; radio === '2'" @click="goaddress"></van-cell>
  60. <van-cell :border="false" is-link center v-if="selectedAddressId !== ''" @click="goaddress">
  61. <template #title>
  62. <div class="f14 c333">{{address.RealName}}{{address.Mobile}}</div>
  63. </template>
  64. <template #label>
  65. <div class="f12 c999">{{address.Areas}}{{address.Address}}</div>
  66. </template>
  67. </van-cell>
  68. </van-cell-group>
  69. </div>
  70. <van-goods-action class="mall-bottom">
  71. <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认申请" @click="onClickButton"></van-goods-action-button>
  72. </van-goods-action>
  73. </div>
  74. <script src="./static/js/klm-vv.min.js"></script>
  75. <script src="./static/js/appfunc.min.js"></script>
  76. <script src="./static/js/klm-axios-config.js"></script>
  77. <script src="./static/js/publicfn.js"></script>
  78. <script>
  79. function OnStart(){
  80. app.getinfo();
  81. };
  82. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  83. // 可以通过下面的方式手动注册
  84. Vue.use(vant.Lazyload);
  85. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  86. // 在 #app 标签下渲染一个按钮组件
  87. let app = new Vue({
  88. el: '#app',
  89. data() {
  90. return {
  91. SNcode:'',
  92. toptitleisshow:false,
  93. active: 0,
  94. radio: '1',
  95. dealNote: '',
  96. selectedAddressId: '',
  97. address: {
  98. },
  99. selectedWarehouseId: '',
  100. warehouse:{
  101. },
  102. productType:'',
  103. toKind:'',
  104. };
  105. },
  106. created() {
  107. this.toptitleisshow = toptitleisshow;
  108. this.getinfo();
  109. this.showsnlist();
  110. },
  111. methods: {
  112. getinfo(){
  113. //- 拿到仓库Id
  114. this.selectedWarehouseId = PublicLib.getCookieInfo('warehouseId');
  115. //- 如果有仓库Id,就发起请求
  116. if(this.selectedWarehouseId !== '') {
  117. this.getwarehousedetail();
  118. };
  119. //- 拿到收货地址Id
  120. this.selectedAddressId = PublicLib.getCookieInfo('addressId');
  121. //- 如果有收货地址Id,就发起请求
  122. if(this.selectedAddressId !== '') {
  123. this.getaddressdetail();
  124. };
  125. },
  126. showsnlist(){
  127. this.SNcode = JSON.parse(PublicLib.getCookieInfo('afterSaleInfo'));
  128. console.log(this.SNcode);
  129. },
  130. //- var UserId = ""; //创客
  131. //- var BackProductType = ""; //退回产品类型
  132. //- var ChangeSnExpand = ""; //转换机器SN来源
  133. //- var Remark = ""; //订单备注
  134. //- var OutStoreId = ""; //出库仓库
  135. //- var PosPhoto = ""; //机具照片
  136. //- var AddressId = ""; //收货地址
  137. //- var DeliveryType = ""; //提货方式
  138. //- var Reason = ""; //换机原因
  139. //- var Note = ""; //备注
  140. onClickButton:undebounce(async function() {
  141. if(this.selectedWarehouseId === ''){
  142. return tips('请选择发货仓库!')
  143. };
  144. if(this.selectedAddressId === ''){
  145. return tips('请选择收货地址!')
  146. };
  147. const UserId = PublicLib.getCookieInfo('userId');
  148. const PosPhoto = this.SNcode.photoList.map(item=>item.url).join(',');
  149. const BackProductType = this.SNcode.SNtype;
  150. const ChangeSnExpand = this.SNcode.SN;
  151. const OutStoreId = this.selectedWarehouseId;
  152. const Reason = this.SNcode.reson;
  153. const Note = this.SNcode.remaker;
  154. const AddressId = this.selectedAddressId;
  155. const DeliveryType = Number(this.radio);
  156. const Remark = this.dealNote;
  157. const res = await postRequest('api/v1/pos/machinechange/add?t='+Math.random(6),JSON.stringify({UserId,BackProductType,ChangeSnExpand,OutStoreId,AddressId,DeliveryType,Remark,PosPhoto,Reason,Note}));
  158. if(res.status === '-1'){
  159. tips(res.info);
  160. }else if(res.status === '1'){
  161. tips('机具申请发起成功!');
  162. setTimeout(()=>{
  163. PublicLib.GoBack({Level:2});
  164. },2000);
  165. };
  166. }),
  167. goback(){
  168. PublicLib.GoBack({Level:1});
  169. //- 清除仓库Id
  170. PublicLib.putCookieInfo('warehouseId', '');
  171. //- 清除收货地址Id
  172. PublicLib.putCookieInfo('addressId', '');
  173. PublicLib.putCookieInfo('isApplyBack','true');
  174. },
  175. gowarehouse(){
  176. PublicLib.putCookieInfo('wareBrandId', JSON.parse(PublicLib.getCookieInfo('afterSaleInfo')).SNtype);
  177. PublicLib.Goto({Url:'mall-warehouse-list'});
  178. },
  179. goaddress(){
  180. PublicLib.Goto({Url:'mall-address-list'});
  181. },
  182. //- 获取发货仓详情
  183. async getwarehousedetail(){
  184. const UserId = PublicLib.getCookieInfo('userId');
  185. const res = await getRequest('api/v1/storehouse/sendstoredetail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedWarehouseId}));
  186. if(res.status !== '1') return tips('获取发货仓库详情失败,请重试!');
  187. this.warehouse = res.data;
  188. },
  189. //- 获取收货地址详情
  190. async getaddressdetail(){
  191. const UserId = PublicLib.getCookieInfo('userId');
  192. const res = await getRequest('api/v1/useraddress/detail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedAddressId}));
  193. if(res.status !== '1') return tips('获取收货信息失败,请重试!');
  194. this.address = res.data;
  195. },
  196. applyrecord(){
  197. PublicLib.Goto({Url:'product-aftersale-list'});
  198. }
  199. }
  200. });
  201. </script>
  202. </body>
  203. </html>