123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>售后换新-产品中心-创业帮</title>
- <meta name="keywords" content="售后换新-产品中心-创业帮">
- <meta name="description" content="售后换新-产品中心-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="售后换新-产品中心-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgc-back apply pb0 pt0" style="padding-top:0;">
- <div id="app">
- <van-nav-bar class="user_rank_explan_title user_title_normal rightc333" left-arrow title="售后换新" v-if="toptitleisshow" @click-left="goback" @click-right="applyrecord">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="deal-check" v-cloak style="padding-bottom:50px;">
- <van-cell-group class="deal-check1" :border="false">
- <van-card centered>
- <template #title>
- <van-cell-group :border="false">
- <van-cell class="machine-list machine-list1" value-class="f14 c999" center :border="false">
- <template #title>
- <div class="f14 c333"><span class="vm">SN:</span><span class="vm pr16">{{SNcode.SN}}</span></div>
- </template>
- </van-cell>
- </van-cell-group>
- </template>
- </van-card>
- </van-cell-group>
- <van-cell-group :border="false" title="发货仓库">
- <van-cell title="请选择离收货地址最近的仓库" :border="false" is-link center v-if="selectedWarehouseId === ''" @click="gowarehouse"></van-cell>
- <van-cell :border="false" is-link center v-if="selectedWarehouseId !== ''" @click="gowarehouse">
- <template #title>
- <div class="f14 c333">{{warehouse.StoreName}}(库存{{warehouse.LaveNum}}台)</div>
- </template>
- <template #label>
- <div class="f12 c999">联系人:{{warehouse.ManageName}}{{warehouse.ManageMobile}}</div>
- <div class="f12 c999">地址:{{warehouse.Areas}}{{warehouse.Address}}</div>
- </template>
- </van-cell>
- <van-cell title="提货方式" :border="false">
- <template #right-icon>
- <van-radio-group v-model="radio" direction="horizontal">
- <van-radio name="1">邮寄到付</van-radio>
- <van-radio name="2">上门自提</van-radio>
- </van-radio-group>
- </template>
- </van-cell>
- <van-field v-model="dealNote" name="订单备注" label="订单备注" placeholder="默认韵达快递,选择其他快递请备注" :rules="[{ required: true, message: '请填写用户名' }]"></van-field>
- </van-cell-group>
- <van-cell-group :border="false" title="收货信息">
- <van-cell title="请选择收货地址" :border="false" is-link v-if="selectedAddressId === '' && radio === '1'" @click="goaddress"></van-cell>
- <van-cell title="请选择提货人信息" :border="false" is-link v-if="selectedAddressId === '' && radio === '2'" @click="goaddress"></van-cell>
- <van-cell :border="false" is-link center v-if="selectedAddressId !== ''" @click="goaddress">
- <template #title>
- <div class="f14 c333">{{address.RealName}}{{address.Mobile}}</div>
- </template>
- <template #label>
- <div class="f12 c999">{{address.Areas}}{{address.Address}}</div>
- </template>
- </van-cell>
- </van-cell-group>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button type="default" color="#FFD500" style="color:#333;" text="确认申请" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- app.getinfo();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- SNcode:'',
- toptitleisshow:false,
- active: 0,
- radio: '1',
- dealNote: '',
- selectedAddressId: '',
- address: {
- },
- selectedWarehouseId: '',
- warehouse:{
- },
- productType:'',
- toKind:'',
-
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- this.getinfo();
- this.showsnlist();
- },
- methods: {
- getinfo(){
- //- 拿到仓库Id
- this.selectedWarehouseId = PublicLib.getCookieInfo('warehouseId');
- //- 如果有仓库Id,就发起请求
- if(this.selectedWarehouseId !== '') {
- this.getwarehousedetail();
- };
- //- 拿到收货地址Id
- this.selectedAddressId = PublicLib.getCookieInfo('addressId');
- //- 如果有收货地址Id,就发起请求
- if(this.selectedAddressId !== '') {
- this.getaddressdetail();
- };
- },
- showsnlist(){
- this.SNcode = JSON.parse(PublicLib.getCookieInfo('afterSaleInfo'));
- console.log(this.SNcode);
- },
- //- var UserId = ""; //创客
- //- var BackProductType = ""; //退回产品类型
- //- var ChangeSnExpand = ""; //转换机器SN来源
- //- var Remark = ""; //订单备注
- //- var OutStoreId = ""; //出库仓库
- //- var PosPhoto = ""; //机具照片
- //- var AddressId = ""; //收货地址
- //- var DeliveryType = ""; //提货方式
- //- var Reason = ""; //换机原因
- //- var Note = ""; //备注
- onClickButton:undebounce(async function() {
- if(this.selectedWarehouseId === ''){
- return tips('请选择发货仓库!')
- };
- if(this.selectedAddressId === ''){
- return tips('请选择收货地址!')
- };
- const UserId = PublicLib.getCookieInfo('userId');
- const PosPhoto = this.SNcode.photoList.map(item=>item.url).join(',');
- const BackProductType = this.SNcode.SNtype;
- const ChangeSnExpand = this.SNcode.SN;
- const OutStoreId = this.selectedWarehouseId;
- const Reason = this.SNcode.reson;
- const Note = this.SNcode.remaker;
- const AddressId = this.selectedAddressId;
- const DeliveryType = Number(this.radio);
- const Remark = this.dealNote;
- 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}));
- if(res.status === '-1'){
- tips(res.info);
- }else if(res.status === '1'){
- tips('机具申请发起成功!');
- setTimeout(()=>{
- PublicLib.GoBack({Level:2});
- },2000);
- };
- }),
- goback(){
- PublicLib.GoBack({Level:1});
- //- 清除仓库Id
- PublicLib.putCookieInfo('warehouseId', '');
- //- 清除收货地址Id
- PublicLib.putCookieInfo('addressId', '');
- PublicLib.putCookieInfo('isApplyBack','true');
- },
- gowarehouse(){
- PublicLib.putCookieInfo('wareBrandId', JSON.parse(PublicLib.getCookieInfo('afterSaleInfo')).SNtype);
- PublicLib.Goto({Url:'mall-warehouse-list'});
- },
- goaddress(){
- PublicLib.Goto({Url:'mall-address-list'});
- },
- //- 获取发货仓详情
- async getwarehousedetail(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/storehouse/sendstoredetail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedWarehouseId}));
- if(res.status !== '1') return tips('获取发货仓库详情失败,请重试!');
- this.warehouse = res.data;
- },
- //- 获取收货地址详情
- async getaddressdetail(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('api/v1/useraddress/detail?t='+Math.random(6),JSON.stringify({UserId,Id:this.selectedAddressId}));
- if(res.status !== '1') return tips('获取收货信息失败,请重试!');
- this.address = res.data;
- },
- applyrecord(){
- PublicLib.Goto({Url:'product-aftersale-list'});
- }
-
- }
- });
- </script>
- </body>
- </html>
|