aXin-0810 9 mēneši atpakaļ
vecāks
revīzija
8fb63ba7d4

+ 55 - 52
src/packageMaterial/pages/apply/index.vue

@@ -5,20 +5,20 @@
       <view class="item" @tap="toChooseWebsite">
         <view class="label"><text>*</text>购买网点</view>
         <view class="picker">
-          <text class="value" v-if="websit">{{websit.name}}</text>
+          <text class="value" v-if="websit">{{ websit.name }}</text>
           <text class="placeholder" v-else>请选择</text>
           <text class="iconfont icon-jinru"></text>
         </view>
       </view>
       <view class="item">
         <view class="label"><text>*</text>申领人员</view>
-        <view class="value">{{userInfo.nickName}}</view>
+        <view class="value">{{ userInfo.nickName }}</view>
       </view>
       <view class="item">
         <view class="label"><text>*</text>产品类别</view>
         <u-radio-group v-model="type">
-        	<u-radio shape="circle" label="辅材" :name="'M'"></u-radio>
-        	<u-radio shape="circle" label="配件" :name="'P'"></u-radio>
+          <u-radio shape="circle" label="辅材" :name="'M'"></u-radio>
+          <u-radio shape="circle" label="配件" :name="'P'"></u-radio>
         </u-radio-group>
       </view>
     </view>
@@ -32,67 +32,70 @@
   <!-- #endif -->
 
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/packageMaterial/pages/apply/index`, pam, crossPagePam)" @message="crossPage.$listener"></web-view>
+  <web-view
+    :src="webViewHref(`/packageMaterial/pages/apply/index`, pam, crossPagePam)"
+    @message="crossPage.$listener"
+  ></web-view>
   <!-- #endif -->
 </template>
 
 <script>
-  // #ifdef H5
-  export default {
-    data() {
-      return {
-        userInfo: {},
-        websit: null,
-        type: 'M',
-      }
-    },
-
-    async onLoad({type}) {
-      this.type = type || 'M';
-			this.userInfo = await this.$getUserInfo();
-      this.getWebsitList();
+// #ifdef H5
+export default {
+  data() {
+    return {
+      userInfo: {},
+      websit: null,
+      type: 'M',
+    }
+  },
 
-      this.crossPage.$on('chooseMaterialApplyWebsit', data => {
-        this.websit = data;
-      });
-    },
+  async onLoad({type}) {
+    this.type = type || 'M';
+	this.userInfo = await this.$getUserInfo();
+    this.getWebsitList();
 
-    methods: {
-      getWebsitList() {
-        this.$api.get('/user/apply/websit')
-        .then(res => {
-          this.websit = res.data.find(o => o.isDefaultWebsit)
-        })
-      },
+    this.crossPage.$on('chooseMaterialApplyWebsit', data => {
+      this.websit = data;
+    });
+  },
 
-      toChooseWebsite() {
-        this.$navToPage({
-          url: `/packageMaterial/pages/apply/website`
-        })
-      },
+  methods: {
+    getWebsitList() {
+      this.$api.get('/user/apply/websit')
+      .then(res => {
+        this.websit = res.data.find(o => o.isDefaultWebsit)
+      })
+    },
 
-      toChooseProduct() {
-        if(!this.websit) return this.$toast('请选择购买网点');
-        this.$navToPage({
-          url: `/packageMaterial/pages/apply/product?type=${this.type}&websitId=${this.websit.websitId}&websitName=${this.websit.name}`
-        })
-      },
+    toChooseWebsite() {
+      this.$navToPage({
+        url: `/packageMaterial/pages/apply/website`
+      })
     },
-  }
 
-  // #endif
-  // #ifndef H5
-  export default {
-    data() {
-      return {
-        pam: {},
-      }
+    toChooseProduct() {
+      if(!this.websit) return this.$toast('请选择购买网点');
+      this.$navToPage({
+        url: `/packageMaterial/pages/apply/product?type=${this.type}&websitId=${this.websit.websitId}&websitName=${this.websit.name}`
+      })
     },
-    onLoad(pam) {
-      this.pam = pam;
+  },
+}
+
+// #endif
+// #ifndef H5
+export default {
+  data() {
+    return {
+      pam: {},
     }
+  },
+  onLoad(pam) {
+    this.pam = pam;
   }
-  // #endif
+}
+// #endif
 </script>
 
 <style lang="scss" scoped>

+ 114 - 110
src/packageMaterial/pages/apply/order.vue

@@ -5,12 +5,14 @@
       <view class="common-title">订单信息</view>
       <view class="product-container card">
         <view class="it" v-for="(item, index) in goodsList" :key="index">
-          <view class="name">{{item.goodsName}}<text>×{{item.num}}{{item.goodsSalesUnit}}</text></view>
-          <view class="price">¥{{(item.price * item.num) | priceFilter}}</view>
+          <view class="name"
+            >{{ item.goodsName }}<text>×{{ item.num }}{{ item.goodsSalesUnit }}</text></view
+          >
+          <view class="price">¥{{ (item.price * item.num) | priceFilter }}</view>
         </view>
         <view class="total">
           <view class="text">合计:</view>
-          <view class="price">¥{{totalPrice | priceFilter}}</view>
+          <view class="price">¥{{ totalPrice | priceFilter }}</view>
         </view>
       </view>
 
@@ -18,16 +20,16 @@
         <view class="common-title">提货信息</view>
         <view class="info-container card" v-if="websitData">
           <view class="top">
-            <view class="left">{{websitData.name}}</view>
-            <view class="right">距离{{(websitData.distance / 1000).toFixed(2)}}KM</view>
+            <view class="left">{{ websitData.name }}</view>
+            <view class="right">距离{{ (websitData.distance / 1000).toFixed(2) }}KM</view>
           </view>
           <view class="row">
             <view class="label">联系电话</view>
-            <view class="value">{{websitData.websitPhone}}</view>
+            <view class="value">{{ websitData.websitPhone }}</view>
           </view>
           <view class="row">
             <view class="label">提货地址</view>
-            <view class="value">{{websitData.address}}</view>
+            <view class="value">{{ websitData.address }}</view>
           </view>
         </view>
       </block>
@@ -36,14 +38,13 @@
       <view class="remark-container card">
         <u--textarea v-model="remark" placeholder="请输入内容" border="none" autoHeight></u--textarea>
       </view>
-
     </view>
 
     <template slot="footer">
       <view class="bottom-container">
         <view class="left">
-          <view class="text">共{{totalNum}}件,合计:</view>
-          <view class="price">¥{{totalPrice | priceFilter}}</view>
+          <view class="text">共{{ totalNum }}件,合计:</view>
+          <view class="price">¥{{ totalPrice | priceFilter }}</view>
         </view>
         <view class="btn">
           <u-button type="primary" text="确认订单" @click="submitData"></u-button>
@@ -54,123 +55,126 @@
   <!-- #endif -->
 
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/packageMaterial/pages/apply/order`, pam, crossPagePam)" @message="crossPage.$listener"></web-view>
+  <web-view
+    :src="webViewHref(`/packageMaterial/pages/apply/order`, pam, crossPagePam)"
+    @message="crossPage.$listener"
+  ></web-view>
   <!-- #endif -->
 </template>
 
 <script>
-  // #ifdef H5
-  export default {
-    data() {
-      return {
-        type: 'M',
-        applyName: '',
-        websitId: null,
-        websitName: null,
-        goodsList: [],
+// #ifdef H5
+export default {
+  data() {
+    return {
+      type: 'M',
+      applyName: '',
+      websitId: null,
+      websitName: null,
+      goodsList: [],
 
-        lat: '',
-        lng: '',
-        websitData: null,
-        userInfo: {},
-        remark: '',
-      }
-    },
+      lat: '',
+      lng: '',
+      websitData: null,
+      userInfo: {},
+      remark: '',
+    }
+  },
 
-    computed: {
-      totalNum() {
-        // let val = 0;
-        // this.goodsList.forEach(item => {
-        //   val = val + item.num;
-        // })
-        return this.goodsList.length;
-      },
-      totalPrice() {
-        let val = 0;
-        this.goodsList.forEach(item => {
-          val = val + (item.num * (item.price * 100) / 100);
-        })
-        return  val;
-      },
+  computed: {
+    totalNum() {
+      // let val = 0;
+      // this.goodsList.forEach(item => {
+      //   val = val + item.num;
+      // })
+      return this.goodsList.length;
     },
+    totalPrice() {
+      let val = 0;
+      this.goodsList.forEach(item => {
+        val = val + (item.num * (item.price * 100) / 100);
+      })
+      return  val;
+    },
+  },
 
-    async onLoad() {
-      let data = this.$getStorage('materialApplyData');
-      if(data) {
-        this.type = data.type;
-        this.applyName = data.applyName;
-        this.websitId = data.websitId;
-        this.websitName = data.websitName;
-        this.goodsList = data.goodsList;
-      }
-      this.$removeStorage('materialApplyData');
+  async onLoad() {
+    let data = this.$getStorage('materialApplyData');
+    if(data) {
+      this.type = data.type;
+      this.applyName = data.applyName;
+      this.websitId = data.websitId;
+      this.websitName = data.websitName;
+      this.goodsList = data.goodsList;
+    }
+    this.$removeStorage('materialApplyData');
 
-      this.userInfo = await this.$getUserInfo();
-      await this.getLocation();
-      this.getWebsitList();
-    },
+    this.userInfo = await this.$getUserInfo();
+    await this.getLocation();
+    this.getWebsitList();
+  },
 
-    methods: {
-      // 获取位置
-      async getLocation() {
-      	return await new Promise((resolve, reject) => {
-      		uni.getLocation({
-      			type: 'gcj02',
-      			isHighAccuracy: true,
-      			geocode: true,
-      			success: (res) => {
-      				this.lat = res.latitude;
-      				this.lng = res.longitude;
-      				resolve(res);
-      			},
-      			fail: (res) => {
-      				reject(0);
-      			}
-      		});
-      	});
-      },
+  methods: {
+    // 获取位置
+    async getLocation() {
+    	return await new Promise((resolve, reject) => {
+    		uni.getLocation({
+    			type: 'gcj02',
+    			isHighAccuracy: true,
+    			geocode: true,
+    			success: (res) => {
+    				this.lat = res.latitude;
+    				this.lng = res.longitude;
+    				resolve(res);
+    			},
+    			fail: (res) => {
+    				reject(0);
+    			}
+    		});
+    	});
+    },
 
-      getWebsitList() {
-        this.$api.get('/user/apply/websit', {
-          lat: this.lat,
-          lng: this.lng,
-        }).then(res => {
-          this.websitData = res.data.find(o => o.websitId == this.websitId)
-        })
-      },
+    getWebsitList() {
+      this.$api.get('/user/apply/websit', {
+        lat: this.lat,
+        lng: this.lng,
+      }).then(res => {
+        this.websitData = res.data.find(o => o.websitId == this.websitId)
+      })
+    },
 
-      submitData() {
-        this.$api.postJson('/material/salses/add', {
-          goodsType: this.type,
-          remark: this.remark,
-          workerId: this.userInfo.userId,
-          workerName: this.userInfo.nickName,
-          companyWechatId: this.userInfo.companyWechatId,
-          websitId: this.websitId,
-          websitName: this.websitName,
-          websitBuyGoods: this.goodsList,
-        }).then(res => {
-          this.$navToPage({
-            url: `/packageMaterial/pages/apply/pay?orderId=${res.data}`
-          })
+    submitData() {
+      this.$api.postJson('/material/salses/add', {
+        goodsType: this.type,
+        remark: this.remark,
+        workerId: this.userInfo.userId,
+        workerName: this.userInfo.nickName,
+        companyWechatId: this.userInfo.companyWechatId,
+        websitId: this.websitId,
+        websitName: this.websitName,
+        websitBuyGoods: this.goodsList,
+      }).then(res => {
+        this.$navToPage({
+          url: `/packageMaterial/pages/apply/pay?orderId=${res.data}`
         })
-      },
+      })
     },
-  }
+  },
+}
 
-  // #endif
-  // #ifndef H5
-  export default {
-    data() {
-      return {
-        pam: {},
-      }
-    },
-    onLoad(pam) {
-      this.pam = pam;
+// #endif
+// #ifndef H5
+export default {
+  data() {
+    return {
+      pam: {},
     }
+  },
+  onLoad(pam) {
+    this.pam = pam;
   }
-  // #endif
+}
+// #endif
 </script>
 
 <style lang="scss" scoped>

+ 29 - 15
src/packageMaterial/pages/apply/pay.vue

@@ -27,7 +27,7 @@
           <!-- <view class="row"><text>操作人:</text>模式一</view> -->
         </view>
 
-        <view class="pay-container card mt30">
+        <!-- <view class="pay-container card mt30">
           <view class="top">请选择客户支付方式</view>
           <view class="item">
             <view class="left">
@@ -38,6 +38,24 @@
               <text class="iconfont icon-danxuan2 active"></text>
             </view>
           </view>
+        </view> -->
+
+        <view class="pay-container card mt30">
+          <view class="top">支付信息</view>
+          <view class="item" v-for="(item, index) in 3" :key="index" @click="payNo = index">
+            <view class="left">
+              <text
+                :class="{
+                  iconfont: true,
+                  'icon-danxuan2': true,
+                  active: payNo === index
+                }"
+              ></text>
+            </view>
+            <view class="right">
+              <text class="text">微信支付</text>
+            </view>
+          </view>
         </view>
       </view>
 
@@ -61,7 +79,8 @@ export default {
       loadStatus: 0,
       errorText: '',
       detail: null,
-      canScanCode: 0
+      canScanCode: 0,
+      payNo: ''
     }
   },
 
@@ -307,28 +326,23 @@ export default {
     margin: 20rpx 0;
 
     .left {
-      display: flex;
-      align-items: center;
-
       .iconfont {
-        font-size: 44rpx;
-        color: #43c93e;
+        font-size: 40rpx;
+        color: $sec-font;
       }
-
       .text {
         margin-left: 18rpx;
         font-size: 32rpx;
       }
+      .active {
+        color: $theme-color;
+      }
     }
 
     .right {
-      .iconfont {
-        font-size: 40rpx;
-        color: $sec-font;
-
-        &.active {
-          color: $theme-color;
-        }
+      .text {
+        margin-left: 18rpx;
+        font-size: 32rpx;
       }
     }
   }

+ 208 - 193
src/packageMaterial/pages/apply/product.vue

@@ -9,30 +9,39 @@
           placeholder="输入分类名称进行搜索"
           v-model="keyword"
           @search="searchData"
-          @clear="searchData">
+          @clear="searchData"
+        >
         </u-search>
       </view>
     </template>
 
     <view class="main-container">
       <view class="left-list" v-if="type == 'M'">
-      	<block v-for="(item, index) in leftList" :key='index'>
-      		<view class="item ellipsis" :class="leftCurrent == item.categoryId ? 'current':''" @tap="changeLeft(item.categoryId)">{{item.categoryName}}</view>
-      	</block>
+        <block v-for="(item, index) in leftList" :key="index">
+          <view
+            class="item ellipsis"
+            :class="leftCurrent == item.categoryId ? 'current' : ''"
+            @tap="changeLeft(item.categoryId)"
+            >{{ item.categoryName }}</view
+          >
+        </block>
       </view>
       <view class="right-list">
         <scroll-view scroll-y style="height: 100%">
-          <view class="item" v-for="(item, index) in rightList" :key='index'>
-            <view class="name">{{item.goodsName}}</view>
-            <view class="text">代码:{{item.goodsCode}}</view>
+          <view class="item" v-for="(item, index) in rightList" :key="index">
+            <view class="name">{{ item.goodsName }}</view>
+            <view class="text">代码:{{ item.goodsCode }}</view>
             <view class="bottom">
-              <view class="price">¥{{item.price | priceFilter}}<text>/{{item.goodsSalesUnit}}</text></view>
+              <view class="price"
+                >¥{{ item.price | priceFilter }}<text>/{{ item.goodsSalesUnit }}</text></view
+              >
               <u-number-box
                 min="0"
                 :step="item.goodsSalesUnit == '米' ? 1 : 1"
                 :name="item.goodsId"
                 v-model="item.num"
-                @change="changeNum">
+                @change="changeNum"
+              >
                 <view slot="minus" class="ctrl">
                   <u-icon name="minus" color="#FFFFFF" size="12"></u-icon>
                 </view>
@@ -43,7 +52,7 @@
                     inputAlign="center"
                     border="none"
                     v-model="item.num"
-                    @blur="changeNum({name: item.goodsId, value: item.num, unit: item.goodsSalesUnit})"
+                    @blur="changeNum({ name: item.goodsId, value: item.num, unit: item.goodsSalesUnit })"
                   ></u--input>
                 </text>
                 <view slot="plus" class="ctrl">
@@ -53,7 +62,7 @@
             </view>
           </view>
         </scroll-view>
-      	<Loading :type="2" :loadStatus="loadStatus" :dataList="rightList" />
+        <Loading :type="2" :loadStatus="loadStatus" :dataList="rightList" />
       </view>
     </view>
 
@@ -64,17 +73,20 @@
         <view class="right" @tap="clearCart"><text class="iconfont icon-shanchu"></text>清空购物车</view>
       </view>
       <view class="list">
-        <view class="item" v-for="(item, index) in cartList" :key='index'>
-          <view class="name">{{item.goodsName}}</view>
+        <view class="item" v-for="(item, index) in cartList" :key="index">
+          <view class="name">{{ item.goodsName }}</view>
           <view class="bottom">
-            <view class="price">¥{{item.price | priceFilter}}<text>/{{item.goodsSalesUnit}}</text></view>
+            <view class="price"
+              >¥{{ item.price | priceFilter }}<text>/{{ item.goodsSalesUnit }}</text></view
+            >
             <u-number-box
               :step="item.goodsSalesUnit == '米' ? 1 : 1"
               :min="item.goodsSalesUnit == '米' ? 0.1 : 1"
               :name="item.goodsId"
               v-model="item.num"
               @change="changeCartNum"
-              @overlimit="overlimitFun(index)">
+              @overlimit="overlimitFun(index)"
+            >
               <view slot="minus" class="ctrl">
                 <u-icon name="minus" color="#FFFFFF" size="12"></u-icon>
               </view>
@@ -85,7 +97,7 @@
                   inputAlign="center"
                   border="none"
                   v-model="item.num"
-                  @blur="changeCartNum({name: item.goodsId, value: item.num, unit: item.goodsSalesUnit})"
+                  @blur="changeCartNum({ name: item.goodsId, value: item.num, unit: item.goodsSalesUnit })"
                 ></u--input>
               </text>
               <view slot="plus" class="ctrl">
@@ -103,7 +115,7 @@
           <text class="iconfont icon-gouwuche1"></text>
           <u-badge max="99" :value="totalNum" :offset="[1, 1]" absolute></u-badge>
         </view>
-        <view class="price"><text>合计:</text>¥{{totalPrice | priceFilter}}</view>
+        <view class="price"><text>合计:</text>¥{{ totalPrice | priceFilter }}</view>
         <view class="btn">
           <u-button type="primary" text="提交" @click="submitData"></u-button>
         </view>
@@ -113,203 +125,206 @@
   <!-- #endif -->
 
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref(`/packageMaterial/pages/apply/product`, pam, crossPagePam)" @message="crossPage.$listener"></web-view>
+  <web-view
+    :src="webViewHref(`/packageMaterial/pages/apply/product`, pam, crossPagePam)"
+    @message="crossPage.$listener"
+  ></web-view>
   <!-- #endif -->
 </template>
 
 <script>
-  // #ifdef H5
-  export default {
-    data() {
-      return {
-        type: 'M',
-        applyName: '',
-        websitId: null,
-        websitName: null,
+// #ifdef H5
+export default {
+  data() {
+    return {
+      type: 'M',
+      applyName: '',
+      websitId: null,
+      websitName: null,
 
-        keyword: '',
-				leftList: [],
-				leftCurrent: 0,
-				rightList: [],
-        loadStatus: 0,
-        isShowDialog: false,
+      keyword: '',
+		leftList: [],
+		leftCurrent: 0,
+		rightList: [],
+      loadStatus: 0,
+      isShowDialog: false,
 
-        cartList: [],
-      }
-    },
+      cartList: [],
+    }
+  },
 
-    computed: {
-      totalNum() {
-        // let val = 0;
-        // this.cartList.forEach(item => {
-        //   val = val + item.num;
-        // })
-        return this.cartList.length;
-      },
-      totalPrice() {
-        let val = 0;
-        this.cartList.forEach(item => {
-          val = val + (item.num * (item.price * 100) / 100);
-        })
-        return val;
-      },
+  computed: {
+    totalNum() {
+      // let val = 0;
+      // this.cartList.forEach(item => {
+      //   val = val + item.num;
+      // })
+      return this.cartList.length;
     },
-
-    onLoad({type, applyName, websitId, websitName}) {
-      this.type = type;
-      this.applyName = applyName;
-      this.websitId = websitId;
-      this.websitName = websitName;
-
-      uni.setNavigationBarTitle({
-       title: type == 'M' ? '选择辅材' : '选择配件'
+    totalPrice() {
+      let val = 0;
+      this.cartList.forEach(item => {
+        val = val + (item.num * (item.price * 100) / 100);
       })
-      if(type === 'M') {
-        this.getLeftList();
-      }else {
-        this.getRightList();
-      }
+      return val;
     },
+  },
 
-    methods: {
-      // 获取左侧分类
-      getLeftList() {
-      	this.$api.post('/material/salses/exist/stock/category', {
-          websitId: this.websitId,
-        }).then(res => {
-      		this.leftList = res.data;
-      		this.leftCurrent = res.data.length > 0 ? res.data[0].categoryId : 0;
-      		this.getRightList();
-      	})
-      },
+  onLoad({type, applyName, websitId, websitName}) {
+    this.type = type;
+    this.applyName = applyName;
+    this.websitId = websitId;
+    this.websitName = websitName;
 
-      // 获取右侧产品
-      getRightList() {
-      	this.loadStatus = 1;
-        let url = '', params = {};
-      	this.$api.post('/material/salses/exist/stock/goods', {
-          websitId: this.websitId,
-          goodsName: this.keyword,
-          type: this.type,
-          categoryId: this.type === 'M' ? this.leftCurrent : '',
-      	}).then(res => {
-      		this.loadStatus = 0;
-          let list = res.data.map(item => {
-            return {
-              ...item,
-              num: 0,
-            }
-          });
-          for(let i = 0; i < list.length; i++) {
-            for(let j = 0; j < this.cartList.length; j++) {
-              if(list[i].goodsId == this.cartList[j].goodsId) {
-                list[i].num = this.cartList[j].num;
-              }
+    uni.setNavigationBarTitle({
+     title: type == 'M' ? '选择辅材' : '选择配件'
+    })
+    if(type === 'M') {
+      this.getLeftList();
+    }else {
+      this.getRightList();
+    }
+  },
+
+  methods: {
+    // 获取左侧分类
+    getLeftList() {
+    	this.$api.post('/material/salses/exist/stock/category', {
+        websitId: this.websitId,
+      }).then(res => {
+    		this.leftList = res.data;
+    		this.leftCurrent = res.data.length > 0 ? res.data[0].categoryId : 0;
+    		this.getRightList();
+    	})
+    },
+
+    // 获取右侧产品
+    getRightList() {
+    	this.loadStatus = 1;
+      let url = '', params = {};
+    	this.$api.post('/material/salses/exist/stock/goods', {
+        websitId: this.websitId,
+        goodsName: this.keyword,
+        type: this.type,
+        categoryId: this.type === 'M' ? this.leftCurrent : '',
+    	}).then(res => {
+    		this.loadStatus = 0;
+        let list = res.data.map(item => {
+          return {
+            ...item,
+            num: 0,
+          }
+        });
+        for(let i = 0; i < list.length; i++) {
+          for(let j = 0; j < this.cartList.length; j++) {
+            if(list[i].goodsId == this.cartList[j].goodsId) {
+              list[i].num = this.cartList[j].num;
             }
           }
-      		if(list.length < 1){
-      			this.loadStatus = 2;
-      		}
-      		this.rightList = list;
-      	}).catch(() => {
-      		this.loadStatus = 2;
-      	})
-      },
+        }
+    		if(list.length < 1){
+    			this.loadStatus = 2;
+    		}
+    		this.rightList = list;
+    	}).catch(() => {
+    		this.loadStatus = 2;
+    	})
+    },
 
-      // 切换一级菜单
-      changeLeft(pid) {
-      	this.leftCurrent = pid;
-      	this.getRightList();
-      },
+    // 切换一级菜单
+    changeLeft(pid) {
+    	this.leftCurrent = pid;
+    	this.getRightList();
+    },
 
-      // 搜索
-      searchData() {
-        this.getRightList();
-      },
+    // 搜索
+    searchData() {
+      this.getRightList();
+    },
 
-      changeNum(e) {
-        let obj = this.rightList.find((item) => item.goodsId === e.name);
-        if(e.unit && e.unit != '米') {
-          e.value = Math.floor(e.value);
-          obj.num = Math.floor(obj.num);
-        }
-        // 判断对象数组中是否存在该对象
-        let index = this.cartList.findIndex((item) => item.goodsId === obj.goodsId);
-        // 如果是0,就删除
-        if(index !== -1 && e.value == 0) {
-          this.cartList.splice(index, 1);
-        }
-        // 如果有就替换,没有就添加
-        else if (index !== -1) {
-        	this.cartList.splice(index, 1, obj);
-        }
-        else {
-          if(e.value > 0) {
-            this.cartList.push(obj);
-          }
-        }
-      },
-      
-      changeCartNum(e) {
-        let obj = this.cartList.find((item) => item.goodsId === e.name);
-        if(e.unit && e.unit != '米') {
-          e.value = Math.floor(e.value);
-          obj.num = Math.floor(obj.num);
+    changeNum(e) {
+      let obj = this.rightList.find((item) => item.goodsId === e.name);
+      if(e.unit && e.unit != '米') {
+        e.value = Math.floor(e.value);
+        obj.num = Math.floor(obj.num);
+      }
+      // 判断对象数组中是否存在该对象
+      let index = this.cartList.findIndex((item) => item.goodsId === obj.goodsId);
+      // 如果是0,就删除
+      if(index !== -1 && e.value == 0) {
+        this.cartList.splice(index, 1);
+      }
+      // 如果有就替换,没有就添加
+      else if (index !== -1) {
+      	this.cartList.splice(index, 1, obj);
+      }
+      else {
+        if(e.value > 0) {
+          this.cartList.push(obj);
         }
-        let index = this.cartList.findIndex((item) => item.goodsId === obj.goodsId);
-        this.cartList.splice(index, 1, obj);
-      
-        this.getRightList();
-      },
+      }
+    },
 
-      overlimitFun(index) {
-        this.$modal({
-          content: '把该产品从购物车移除?'
-        }).then(() => {
-          this.cartList.splice(index, 1);
-          this.getRightList();
-        }).catch(() => {})
-      },
+    changeCartNum(e) {
+      let obj = this.cartList.find((item) => item.goodsId === e.name);
+      if(e.unit && e.unit != '米') {
+        e.value = Math.floor(e.value);
+        obj.num = Math.floor(obj.num);
+      }
+      let index = this.cartList.findIndex((item) => item.goodsId === obj.goodsId);
+      this.cartList.splice(index, 1, obj);
 
-      clearCart() {
-        this.$modal({
-          content: '确定清空购物车?'
-        }).then(() => {
-          this.cartList = [];
-          this.getRightList();
-        }).catch(() => {})
-      },
+      this.getRightList();
+    },
 
-      submitData() {
-        if(this.cartList.length < 1) return this.$toast('请选择');
-        this.$setStorage('materialApplyData', {
-          type: this.type,
-          applyName: this.applyName,
-          websitId: this.websitId,
-          websitName: this.websitName,
-          goodsList: this.cartList
-        });
-        this.$navToPage({
-          url: `/packageMaterial/pages/apply/order`
-        })
-      },
+    overlimitFun(index) {
+      this.$modal({
+        content: '把该产品从购物车移除?'
+      }).then(() => {
+        this.cartList.splice(index, 1);
+        this.getRightList();
+      }).catch(() => {})
+    },
 
+    clearCart() {
+      this.$modal({
+        content: '确定清空购物车?'
+      }).then(() => {
+        this.cartList = [];
+        this.getRightList();
+      }).catch(() => {})
     },
-  }
 
-  // #endif
-  // #ifndef H5
-  export default {
-    data() {
-      return {
-        pam: {},
-      }
+    submitData() {
+      if(this.cartList.length < 1) return this.$toast('请选择');
+      this.$setStorage('materialApplyData', {
+        type: this.type,
+        applyName: this.applyName,
+        websitId: this.websitId,
+        websitName: this.websitName,
+        goodsList: this.cartList
+      });
+      this.$navToPage({
+        url: `/packageMaterial/pages/apply/order`
+      })
     },
-    onLoad(pam) {
-      this.pam = pam;
+
+  },
+}
+
+// #endif
+// #ifndef H5
+export default {
+  data() {
+    return {
+      pam: {},
     }
+  },
+  onLoad(pam) {
+    this.pam = pam;
   }
-  // #endif
+}
+// #endif
 </script>
 
 <style lang="scss" scoped>
@@ -319,10 +334,10 @@
   ::v-deep .u-search {
     height: 60rpx;
     input {
-      background: #F7F8FF !important;
+      background: #f7f8ff !important;
     }
     .u-search__content {
-      background: #F7F8FF !important;
+      background: #f7f8ff !important;
       height: 60rpx;
     }
   }
@@ -344,15 +359,15 @@
       align-items: center;
       padding: 0 20rpx;
       &.current {
-        color: #FFFFFF;
+        color: #ffffff;
         background: $theme-color;
       }
     }
   }
   .right-list {
     flex: 1;
-    background: #FFFFFF;
-    background: #FFFFFF;
+    background: #ffffff;
+    background: #ffffff;
     height: 100%;
     box-sizing: border-box;
     .item {
@@ -446,7 +461,7 @@
   left: 0;
   width: 100%;
   height: 100%;
-  background: rgba($color: #000000, $alpha: .6);
+  background: rgba($color: #000000, $alpha: 0.6);
 }
 .dialog-container {
   width: 100%;

+ 268 - 245
src/packageMaterial/pages/apply/website.vue

@@ -1,272 +1,295 @@
 <template>
-	<view class="app-container">
-		<map
-			class="map-container"
-			:class="isCloseList ? 'close':''"
-			:latitude="center_lat"
-			:longitude="center_lng"
-			:markers="markers"
-			:include-points="includePoints"
-			@markertap="tapMarker">
-		</map>
+  <view class="app-container">
+    <map
+      class="map-container"
+      :class="isCloseList ? 'close' : ''"
+      :latitude="center_lat"
+      :longitude="center_lng"
+      :markers="markers"
+      :include-points="includePoints"
+      @markertap="tapMarker"
+    >
+    </map>
 
-		<view class="list-container" :class="isCloseList ? 'close':''">
-			<view class="switch">
-				<view class="icon" @tap="changeCloseList">
-					<image src="/static/icon/right.png" mode=""></image>
-				</view>
-			</view>
-			<view class="list">
-				<scroll-view
-					scroll-y
-					show-scrollbar
-					scroll-with-animation
-					class="scroll-view">
-					<view class="item" :class="'item_' + (index+1)" v-for="(item, index) in dataList" :key="index" @tap="chooseWebsit(item)">
-						<view class="left" @tap="changeMapCenter(item)">
-							<view class="name">{{item.name}}</view>
-							<view class="row">联系电话:{{item.websitPhone || ''}}</view>
-							<view class="row">联系地址:{{item.address || ''}}</view>
-						</view>
-						<view class="right" @tap.stop>
-              <u-button size="small" plain type="warning" :text="'距离' + (item.distance / 1000).toFixed(2) + 'km'" @click="nav(item)"></u-button>
-              <u-button size="small" type="primary" text="设为默认" :disabled="item.isDefaultWebsit" @click="setDefault(item)"></u-button>
-						</view>
-					</view>
-					<Loading :type="2" :loadStatus="loadStatus" :dataList="dataList" />
-				</scroll-view>
-			</view>
-		</view>
-
-	</view>
+    <view class="list-container" :class="isCloseList ? 'close' : ''">
+      <view class="switch">
+        <view class="icon" @tap="changeCloseList">
+          <image src="/static/icon/right.png" mode=""></image>
+        </view>
+      </view>
+      <view class="list">
+        <scroll-view scroll-y show-scrollbar scroll-with-animation class="scroll-view">
+          <view
+            class="item"
+            :class="'item_' + (index + 1)"
+            v-for="(item, index) in dataList"
+            :key="index"
+            @tap="chooseWebsit(item)"
+          >
+            <view class="left" @tap="changeMapCenter(item)">
+              <view class="name">{{ item.name }}</view>
+              <view class="row">联系电话:{{ item.websitPhone || '' }}</view>
+              <view class="row">联系地址:{{ item.address || '' }}</view>
+            </view>
+            <view class="right" @tap.stop>
+              <u-button
+                size="small"
+                plain
+                type="warning"
+                :text="'距离' + (item.distance / 1000).toFixed(2) + 'km'"
+                @click="nav(item)"
+              ></u-button>
+              <u-button
+                size="small"
+                type="primary"
+                text="设为默认"
+                :disabled="item.isDefaultWebsit"
+                @click="setDefault(item)"
+              ></u-button>
+            </view>
+          </view>
+          <Loading :type="2" :loadStatus="loadStatus" :dataList="dataList" />
+        </scroll-view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				center_lat: '',
-				center_lng: '',
-				lat: '',
-				lng: '',
-				pageNum: 1,
-				loadStatus: 0,
-				dataList: [],
-				isCloseList: false,
+export default {
+  data() {
+    return {
+      center_lat: '',
+      center_lng: '',
+      lat: '',
+      lng: '',
+      pageNum: 1,
+      loadStatus: 0,
+      dataList: [],
+      isCloseList: false,
 
-				markers: [],
-				includePoints: [],
-			}
-		},
+      markers: [],
+      includePoints: []
+    }
+  },
 
-		async onLoad() {
-			await this.getLocation();
-			this.getList();
-		},
+  async onLoad() {
+    await this.getLocation()
+    this.getList()
+  },
 
-		methods: {
-			// 获取位置
-			async getLocation() {
-				return await new Promise((resolve, reject) => {
-					uni.getLocation({
-						type: 'gcj02',
-						isHighAccuracy: true,
-						geocode: true,
-						success: (res) => {
-							console.log(res);
-							this.lat = res.latitude;
-							this.lng = res.longitude;
-							this.center_lat = res.latitude;
-							this.center_lng = res.longitude;
-							this.markers = [{
-								id: 0,
-								latitude: res.latitude,
-								longitude: res.longitude,
-								title: '我的位置',
-								iconPath: '/static/icon/location1.png',
-								width: 30,
-								height: 30,
-							}]
-							resolve(res);
-						},
-						fail: (res) => {
-							reject(0);
-						}
-					});
-				});
-			},
+  methods: {
+    // 获取位置
+    async getLocation() {
+      return await new Promise((resolve, reject) => {
+        uni.getLocation({
+          type: 'gcj02',
+          isHighAccuracy: true,
+          geocode: true,
+          success: res => {
+            console.log(res)
+            this.lat = res.latitude
+            this.lng = res.longitude
+            this.center_lat = res.latitude
+            this.center_lng = res.longitude
+            this.markers = [
+              {
+                id: 0,
+                latitude: res.latitude,
+                longitude: res.longitude,
+                title: '我的位置',
+                iconPath: '/static/icon/location1.png',
+                width: 30,
+                height: 30
+              }
+            ]
+            resolve(res)
+          },
+          fail: res => {
+            reject(0)
+          }
+        })
+      })
+    },
 
-			getList() {
-				this.loadStatus = 1;
-				this.$api.get('/user/apply/websit', {
+    getList() {
+      this.loadStatus = 1
+      this.$api
+        .get('/user/apply/websit', {
           lat: this.lat,
           lng: this.lng
-				}).then(res => {
-					res.data.forEach(item => {
-						item.lat = Number(item.lat);
-						item.lng = Number(item.lng);
-					})
-					this.loadStatus = 0;
-					let list = res.data;
-					this.dataList = list;
+        })
+        .then(res => {
+          res.data.forEach(item => {
+            item.lat = Number(item.lat)
+            item.lng = Number(item.lng)
+          })
+          this.loadStatus = 0
+          let list = res.data
+          this.dataList = list
           let markers = list.map((item, index) => {
-          	return {
-          		id: index + 1,
-          		latitude: item.lat,
-          		longitude: item.lng,
-          		title: item.name,
-          		iconPath: '/static/icon/location2.png',
-          		width: 40,
-          		height: 40,
-          	}
+            return {
+              id: index + 1,
+              latitude: item.lat,
+              longitude: item.lng,
+              title: item.name,
+              iconPath: '/static/icon/location2.png',
+              width: 40,
+              height: 40
+            }
           })
-          this.markers = this.markers.concat(markers);
-          this.includePoints = this.markers.slice(0, 1).concat(markers.slice(0, 5));
-				})
-			},
+          this.markers = this.markers.concat(markers)
+          this.includePoints = this.markers.slice(0, 1).concat(markers.slice(0, 5))
+        })
+    },
 
-			call(item) {
-				uni.makePhoneCall({
-				  phoneNumber: item.linkPhone
-				});
-			},
+    call(item) {
+      uni.makePhoneCall({
+        phoneNumber: item.linkPhone
+      })
+    },
 
-			nav(item) {
-				uni.openLocation({
-					latitude: item.lat,
-					longitude: item.lng,
-					name: item.name,
-					address: item.address,
-					success: (res) => {
-						console.log('success');
-					}
-				});
-			},
+    nav(item) {
+      uni.openLocation({
+        latitude: item.lat,
+        longitude: item.lng,
+        name: item.name,
+        address: item.address,
+        success: res => {
+          console.log('success')
+        }
+      })
+    },
 
-      setDefault(item) {
-        this.$api.post('/user/default/websit', {
+    setDefault(item) {
+      this.$api
+        .post('/user/default/websit', {
           websitId: item.websitId
-        }).then(res => {
-          this.$successToast();
-          this.getList();
         })
-      },
+        .then(res => {
+          this.$successToast()
+          this.getList()
+        })
+    },
 
-			changeCloseList() {
-				this.isCloseList = !this.isCloseList;
-				this.center_lat = this.lat;
-				this.center_lng = this.lng;
-			},
+    changeCloseList() {
+      this.isCloseList = !this.isCloseList
+      this.center_lat = this.lat
+      this.center_lng = this.lng
+    },
 
-			changeMapCenter(item) {
-				this.center_lat = item.lat;
-				this.center_lng = item.lng;
-			},
+    changeMapCenter(item) {
+      this.center_lat = item.lat
+      this.center_lng = item.lng
+    },
 
-			tapMarker(e) {
-			// 	uni.createSelectorQuery().select(".item_"+e.detail.markerId).boundingClientRect((res)=>{
-			// 		console.log(res)
-			//   	}).exec()
-			},
+    tapMarker(e) {
+      // 	uni.createSelectorQuery().select(".item_"+e.detail.markerId).boundingClientRect((res)=>{
+      // 		console.log(res)
+      //   	}).exec()
+    },
 
-      chooseWebsit(item) {
-        this.crossPage.$emit('chooseMaterialApplyWebsit', item, 'H5');
-        this.$navToPage({
-        	delta: 1
-        }, 'navigateBack')
-      },
-		}
-	}
+    chooseWebsit(item) {
+      this.crossPage.$emit('chooseMaterialApplyWebsit', item, 'H5')
+      this.$navToPage(
+        {
+          delta: 1
+        },
+        'navigateBack'
+      )
+    }
+  }
+}
 </script>
 
 <style scoped lang="scss">
-	.app-container {
-		background: #F4F2F2;
-	}
-	.map-container {
-		width: 100%;
-		height: 45vh;
-		&.close {
-			height: 100vh;
-		}
-	}
-	.list-container {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-    z-index: 999;
-		width: 100%;
-		transition: all .5s;
-		.switch {
-			display: flex;
-			justify-content: center;
-			.icon {
-				background: #FFFFFF;
-				padding: 10rpx 40rpx 0;
-				border-radius: 20rpx 20rpx 0 0;
-				image {
-					width: 14rpx;
-					height: 28rpx;
-					display: block;
-					transform: rotate(90deg);
-				}
-			}
-		}
-		&.close {
-			bottom: calc(-60vh + 40rpx);
-			.switch {
-				image {
-					transform: rotate(-90deg);
-				}
-			}
-		}
-		.list {
-			padding: 40rpx 20rpx 0;
-			box-sizing: border-box;
-			background: #FFFFFF;
-			height: 60vh;
-			border-radius: 40rpx 40rpx 0 0;
-		}
-		.scroll-view {
-			height: 100%;
-		}
-		.item {
-			padding: 20rpx;
-			border-bottom: 1px solid #eaeaea;
-			display: flex;
-			justify-content: space-between;
-			&:first-child {
-				padding-top: 0;
-			}
-			.left {
-				flex: 1;
-				.name {
-					color: #333333;
-					font-size: 30rpx;
-					font-weight: 500;
-					margin-bottom: 8rpx;
-				}
-				.row {
-					font-size: 26rpx;
-					color: #999999;
-					margin-top: 12rpx;
-				}
-			}
-			.right {
-				flex-shrink: 0;
-				margin-left: 30rpx;
-				display: flex;
-				flex-direction: column;
-				align-items: flex-end;
-        ::v-deep .u-button {
-          &:first-child {
-            color: #f9ae3d;
-          }
-          &:last-child {
-            margin-top: 20rpx;
-          }
+.app-container {
+  background: #f4f2f2;
+}
+.map-container {
+  width: 100%;
+  height: 45vh;
+  &.close {
+    height: 100vh;
+  }
+}
+.list-container {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  z-index: 999;
+  width: 100%;
+  transition: all 0.5s;
+  .switch {
+    display: flex;
+    justify-content: center;
+    .icon {
+      background: #ffffff;
+      padding: 10rpx 40rpx 0;
+      border-radius: 20rpx 20rpx 0 0;
+      image {
+        width: 14rpx;
+        height: 28rpx;
+        display: block;
+        transform: rotate(90deg);
+      }
+    }
+  }
+  &.close {
+    bottom: calc(-60vh + 40rpx);
+    .switch {
+      image {
+        transform: rotate(-90deg);
+      }
+    }
+  }
+  .list {
+    padding: 40rpx 20rpx 0;
+    box-sizing: border-box;
+    background: #ffffff;
+    height: 60vh;
+    border-radius: 40rpx 40rpx 0 0;
+  }
+  .scroll-view {
+    height: 100%;
+  }
+  .item {
+    padding: 20rpx;
+    border-bottom: 1px solid #eaeaea;
+    display: flex;
+    justify-content: space-between;
+    &:first-child {
+      padding-top: 0;
+    }
+    .left {
+      flex: 1;
+      .name {
+        color: #333333;
+        font-size: 30rpx;
+        font-weight: 500;
+        margin-bottom: 8rpx;
+      }
+      .row {
+        font-size: 26rpx;
+        color: #999999;
+        margin-top: 12rpx;
+      }
+    }
+    .right {
+      flex-shrink: 0;
+      margin-left: 30rpx;
+      display: flex;
+      flex-direction: column;
+      align-items: flex-end;
+      ::v-deep .u-button {
+        &:first-child {
+          color: #f9ae3d;
+        }
+        &:last-child {
+          margin-top: 20rpx;
         }
-			}
-		}
-	}
+      }
+    }
+  }
+}
 </style>