xuxueyang
2024-07-24 499a94ded67a4c1e763dc6686afe5a2e99faf407
update 订单功能(花店端)
已修改13个文件
已添加3个文件
675 ■■■■ 文件已修改
components/common-address-select/common-address-select.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mixin/mixin.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/help/help.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/user/address/address.vue 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/user/supplier-user.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
plugins/qqmap-wx-jssdk.min.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/common/icon-dp.png 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/self/collect.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/self/follow.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shop/shop.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/shopping/confirm.vue 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/trade/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/supplier/supplier-info/supplier-info.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/common-address-select/common-address-select.vue
@@ -45,7 +45,7 @@
                //获取默认地址并且填充
                if(!this.address.id){
                    this.$message.showLoading()
                    const {data} = await this.$http.request('get','/api/address/customer/default/get')
                    const {data} = await this.$http.request('get','/api/address/default/detail')
                    this.$message.hideLoading()
                    if(data){
                        //提交更新默认地址
@@ -60,7 +60,7 @@
                    return
                }
                uni.navigateTo({
                    url:'/pages/address/address?source=select'
                    url:'/pages/user/address/address?source=select'
                })
            }
        },
manifest.json
@@ -56,7 +56,15 @@
            "minified" : true
        },
        "usingComponents" : true,
        "plugins" : {}
        "permission" : {
        },
        "plugins" : {
            "chooseLocation" : {
                "version" : "1.0.10",
                "provider" : "wx76a9a06e5b4e693e"
            }
        }
    },
    "vueVersion" : "2"
}
mixin/mixin.js
@@ -294,6 +294,9 @@
                    }
                    this.page.total = data.total || 0
                    if (this.getList_after) {
                        this.getList_after()
                    }
                }
                this.$message.hideLoading()
            }
pages.json
@@ -32,8 +32,7 @@
    {
      "path": "pages/user/address/address",
      "style": {
        "navigationBarTitleText": "收货地址",
        "enablePullDownRefresh": false
        "navigationBarTitleText": "收货地址"
      }
    },
    // #endif
@@ -91,6 +90,13 @@
        "navigationBarTitleText": "修改密码",
        "enablePullDownRefresh": false
      }
    },
    {
      "path": "pages/help/help",
      "style": {
        "navigationBarTitleText": "客服中心",
        "enablePullDownRefresh": false
      }
    }
  ],
  "subPackages": [
pages/help/help.vue
对比新文件
@@ -0,0 +1,17 @@
<template>
  <view>
  </view>
</template>
<script>
export default {
  data() {
    return {};
  }
}
</script>
<style lang="scss">
</style>
pages/user/address/address.vue
@@ -28,21 +28,12 @@
            </view>
            <view class="v-line"></view>
            <view class="flex">
                <view class="flex" @click="changeDefaultAddress(item,index)">
                    <!-- <label class="radio flex" > -->
                    <!--         <radio value="r1" :checked="item.defaulted" disabled
                            style="transform:scale(0.6)" v-if="item.defaulted" />
                        <radio value="r1"
                            style="transform:scale(0.6)" :checked="item.defaulted" v-if="!item.defaulted"  @change="changeDefaultAddress(item,index)"/>
                             -->
                    <!-- </label> -->
        <!--        @click="changeDefaultAddress(item,index)"-->
        <view class="flex">
                    <view class="radio m-t-2 m-r-10" :class="[item.defaulted?'select':'']">
                    </view>
                    <span class="desc">{{item.defaulted?'默认地址:':'当前地址:'}}{{item.schoolAreaStr||''}}
                        {{item.blockStr||''}}
                        {{item.room||''}}</span>
          <span class="desc">{{ item.defaulted ? '默认地址:' : '当前地址:' }}{{ item.address || '' }}</span>
                    <!-- 当前地址/默认地址勾选 -->
                </view>
                <view class="desc del t-red" @click="deleteAddress(item)">
@@ -65,7 +56,8 @@
                this.submitForm['area'] = ''
                
                openAddressForm()
            }">添加收货地址</view>
            }">添加收货地址
    </view>
        <uni-popup ref="popup_form" type="top" :mask-click="false">
            <view class="popup-address-form">
@@ -87,10 +79,20 @@
                        <view class="form-item-label require">
                            请选择收获地址
                        </view>
                        <view class="form-item-value">
                            <input v-model="submitForm.room" placeholder="请选择收获地址" disabled class="form-input"></input>
                            <!-- todo 点击定位 -->
            <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']">
              <uni-data-picker :area="true" @change="(e)=>{PickArea(dto,e)}" placeholder=""
                               :localdata="regionDataPlus">
                {{ dto['province'] || '请选择' }}{{ dto['city'] && ('/' + dto['city']) || '' }}{{
                  dto['region'] && ('/' + dto['region']) || ''
                }}
              </uni-data-picker>
              <u-icon class="m-l-a" name="arrow-right"></u-icon>
                        </view>
            <!--            <view class="form-item-value" @click="chooseLocation">-->
            <!--              <input v-model="submitForm.room" placeholder="请选择收获地址" disabled class="form-input"></input>-->
            <!--              &lt;!&ndash;  点击定位 &ndash;&gt;-->
            <!--            </view>-->
                    </view>
                    <view class="form-item">
                        <view class="form-item-label require">
@@ -106,8 +108,8 @@
                            是否默认
                        </view>
                        <view class="form-item-value">
                            <radio value="r1" :checked="submitForm.defaulted"
                                @click="submitForm.defaulted=!submitForm.defaulted"
              <radio value="r1" :checked="submitForm.isDefault"
                     @click="submitForm.isDefault=!submitForm.isDefault"
                                style="transform:scale(0.6);margin-top: -8rpx;" />
                        </view>
                    </view>
@@ -121,6 +123,10 @@
</template>
<script>
// import qqmapwx from '@/plugins/qqmap-wx-jssdk.min.js';
// const lockey = 'VUHBZ-2AMLP-B7AD7-VUQZ7-D4TW5-MFFVN'; //使用在腾讯位置服务申请的key
// const chooseLocation = requirePlugin('chooseLocation');
    export default {
        async onPullDownRefresh() {
            this.page.current = 0
@@ -130,7 +136,7 @@
        async onLoad(options) {
            // this.list = [{}, {}]
            this.source = options.source || ''
            this.listApi = '/api/address/customer/list'
    this.listApi = '/api/address/list'
            await this.getList()
        },
@@ -141,21 +147,102 @@
                    name: '',
                    tel: '',
                    address: '',
                    schoolArea: '',
                    block: '',
                    room: '',
                    defaulted: false
        isDefault: false,
        province: '',
        city: '',
        region: '',
                },
      regionDataPlus: [],
            };
        },
        methods: {
    PickArea(item, e) {
      console.log('PickArea', item, e)
      if (e.detail.value) {
        this.dto.province = ''
        this.dto.city = ''
        this.dto.region = ''
        if (e.detail.value.length <= 3) {
          if (!!e.detail.value[0])
            this.dto.province = e.detail.value[0].value
          if (!!e.detail.value[1])
            this.dto.city = e.detail.value[1].value
          if (!!e.detail.value[2])
            this.dto.region = e.detail.value[2].value
        } else {
          //说明有重复的
          var plusnum = e.detail.value.length - 3
          if (!!e.detail.value[plusnum + 0])
            this.dto.province = e.detail.value[plusnum + 0].value
          if (!!e.detail.value[plusnum + 1])
            this.dto.city = e.detail.value[plusnum + 1].value
          if (!!e.detail.value[plusnum + 2])
            this.dto.region = e.detail.value[plusnum + 2].value
        }
        this.$forceUpdate()
      }
    },
    async init_area() {
      const res = await this.$http.request('get', '/api/pub/china/area/json')
      this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name',
          'text')) || []
    },
    chooseLocation() {
      //前往接口挑选位置
      const qqmapsdk = new qqmapwx({
        // 使用你在腾讯地图应用生成的key
        key: lockey
      });
      uni.getLocation({
        type: 'wgs84',
        success(res) {
          //得到经纬度
          console.log(res);
          qqmapsdk.reverseGeocoder({
            location: {
              latitude: res.latitude,
              longitude: res.longitude
            },
            //成功后的回调
            success: (r) => {
              // console.log('地址信息', r.result.address_component);
              // result: {location: {lat: 31.26249, lng: 120.63212}, address: "江苏省苏州市吴中区太湖东路288号",…}
              // ad_info: {nation_code: "156", adcode: "320506", phone_area_code: "0512", city_code: "156320500",…}
              // address: "江苏省苏州市吴中区太湖东路288号"
              // address_component: {nation: "中国", province: "江苏省", city: "苏州市", district: "吴中区", street: "太湖东路",…}
              // address_reference: {,…}
              // formatted_addresses: {recommend: "长桥苏州市吴中区人民政府(太湖东路北)", rough: "长桥苏州市吴中区人民政府(太湖东路北)"}
              // location: {lat: 31.26249, lng: 120.63212}
              // status: 0
              tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].longitude = r
                  .result.location.lng
              tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].latitude = r
                  .result.location.lat
              tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index].loc_desc = r
                  .result.address
              tmp.formcodes['LOC_ONE'][tmp.tmp_picker_lock_index]._show = false
              tmp.$forceUpdate()
              tmp.tmp_picker_lock_index = -1
            },
            fail: function (res) {
              console.log(res);
              tmp.tmp_picker_lock_index = -1
            },
          });
        }
      });
    },
            async changeDefaultAddress(item, index) {
                if (item.defaulted) {
      if (item.isDefault) {
                    return
                }
                this.$nextTick(() => {
                    // item.defaulted = false
                    // this.$set(item,'defaulted',false)
                    this.$message.confirm('确定设置此地址为默认地址吗').then(async res => {
                        this.$message.showLoading()
                        var {
@@ -163,12 +250,12 @@
                        } = await this.$http.request('post', '/api/address/customer/default/' +
                            item.id, {})
                        this.$message.hideLoading()
                        if (code == 0) {
          if (code === 0) {
                            for (var dto of this.list) {
                                dto.defaulted = false
              dto.isDefault = false
                            }
                            this.$message.showToast('设置成功')
                            item.defaulted = true
            item.isDefault = true
                            this.$store.commit('setDefaultAddress', {
                                ...item
                            })
@@ -200,7 +287,7 @@
                    code
                } = await this.$http.request('get', '/api/address/customer/delete/' + item.id, {})
                this.$message.hideLoading()
                if (code == 0) {
      if (code === 0) {
                    this.$message.showToast('删除成功')
                    setTimeout(() => {
                        this.page.current = 1
@@ -209,11 +296,12 @@
                }
            },
            async openAddressForm() {
      this.init_area()
                if (this.submitForm.id) {
                    this.$message.showLoading()
                    var {
                        data
                    } = await this.$http.request('get', '/api/address/customer/get/' + this.submitForm.id, {})
        } = await this.$http.request('get', '/api/address/list/detail/' + this.submitForm.id, {})
                    if (data) {
@@ -221,8 +309,6 @@
                            ...this.submitForm,
                            ...data
                        }
                        this.blockIndex = -1
                        this.schoolIndex = -1
                    }
                    this.$message.hideLoading()
                } else {
@@ -230,14 +316,11 @@
                        name: this.currentInfo && this.currentInfo.nickName || '',
                        tel: this.currentInfo && this.currentInfo.tel || '',
                        address: '',
                        schoolArea: '',
                        block: '',
                        room: '',
                        defaulted: false
          isDefault: false,
          province: '',
          city: '',
          region: '',
                    }
                    this.schoolIndex = -1
                    this.blockIndex = -1
                    this.blocks = []
                }
                this.$refs.popup_form.open()
@@ -255,12 +338,12 @@
                this.$message.showLoading()
                const {
                    code
                } = await this.$http.request('post', '/api/address/customer/' + (this.submitForm.id ? 'edit' :
                    'new'), {
      } = await this.$http.request('post', '/api/address/' + (this.submitForm.id ? 'update' :
          'edit'), {
                    data: this.submitForm
                })
                this.$message.hideLoading()
                if (code == 0) {
      if (code === 0) {
                    this.$refs.popup_form.close()
                    this.$message.showToast(this.submitForm.id ? '修改成功' : '新增成功')
pages/user/supplier-user.vue
@@ -16,21 +16,24 @@
            <!-- v-if="currentInfo&&(currentInfo.id)" -->
            <view class="flex user-info">
                <!-- 头像 -->
                <image class="user-icon" v-if="!currentInfo.picture" src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
        <image class="user-icon" v-if="!currentInfo.picture"
               src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
                    mode="aspectFit"></image>
                <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image>
                <view class="name" v-if="currentInfo.id">
                    <view class="t1" >
                        {{ (!!currentInfo.supplierDTO?(currentInfo.supplierDTO.name):"") || currentInfo.nickName || currentInfo.loginName || '-'}}<span
            {{
              (!!currentInfo.supplierDTO ? (currentInfo.supplierDTO.name) : "") || currentInfo.nickName || currentInfo.loginName || '-'
            }}<span
                            v-if="currentInfo.supplierDTO&&currentInfo.supplierDTO.status!=='P'">
                            ({{currentInfo.supplierDTO?currentInfo.supplierDTO.statusStr:''}})</span>
                    </view>
                    <view class="t2">{{currentInfo.tel || '暂无电话'}}</view>
                </view>
                <view class="name" v-if="!currentInfo.id" open-type="getUserInfo" @click.stop="getUserProfile" style="font-size: 48rpx;margin-top: 16rpx;">
        <view class="name" v-if="!currentInfo.id" open-type="getUserInfo" @click.stop="getUserProfile"
              style="font-size: 48rpx;margin-top: 16rpx;">
                    {{'点击登陆'}}
                </view>
                <image class="icon-setting" src="../../static/common/icon-setting.png" mode="aspectFit"></image>
@@ -38,17 +41,17 @@
            <!-- #ifdef PUB_CUSTOMER -->
            <view class="customer-info-records">
                <view class="item">
                    <view class="num">59</view>
          <view class="num">{{ tj.collectNum || 0 }}</view>
                    <view class="name">我的收藏</view>
                </view>
                <view class="line"></view>
                <view class="item">
                    <view class="num">5</view>
          <view class="num">{{ tj.followNum || 0 }}</view>
                    <view class="name">关注店铺</view>
                </view>
                <view class="line"></view>
                <view class="item">
                    <view class="num">87</view>
          <view class="num">{{ tj.browseNum || 0 }}</view>
                    <view class="name">浏览记录</view>
                </view>
            </view>
@@ -61,8 +64,10 @@
            <view class="user-util m-t-12">
                <view class="title flex">
                    <view class="flex1">我的订单</view>
                    <view class="m-r-a m-r-0 more">全部订单<uni-icons class="" type="right"
                            size="12"></uni-icons></view>
          <view class="m-r-a m-r-0 more">全部订单
            <uni-icons class="" type="right"
                       size="12"></uni-icons>
          </view>
                </view>
                <view class="flex order-icons-container">
                    <view class="order-icons">
@@ -94,12 +99,12 @@
                    <view>我的服务</view>
                </view>
                <view class="flex service-icons-container">
                    <view class="service-icons">
          <view class="service-icons" @click="goto('/sub_pages/customer/follow/follow',true)">
                        <image src="../../static/images/customer/service/service-icon-1.png" class="service-icon ">
                        </image>
                        <view>关注店铺</view>
                    </view>
                    <view class="service-icons">
          <view class="service-icons" @click="goto('/sub_pages/customer/collect/collect',true)">
                        <image src="../../static/images/customer/service/service-icon-2.png" class="service-icon ">
                        </image>
                        <view>我的收藏</view>
@@ -167,6 +172,9 @@
                    <view class="name">
                        客服电话 : &nbsp;&nbsp; <span class="topic-gray">{{tel}}</span>
                    </view>
          <view class="right-icon"  @click="goto('/pages/help/help',false)">
            <uni-icons type="right"></uni-icons>
          </view>
                </view>
            </view>
            <!--             <view class="user-util m-t-12 " @click="callTel" v-if="selftype==='partner'">
@@ -178,7 +186,6 @@
                </view>
            </view> -->
        </view>
        <!-- #ifdef PUB_CUSTOMER -->
@@ -238,7 +245,6 @@
        <!-- #endif -->
    </view>
</template>
@@ -251,13 +257,28 @@
                tcode: '',
                inviterName: '',
                // StatusBar:0,
                tel: '15974805814'
      tel: '15974805814',
      tj: {},
            };
        },
        onLoad(options) {
            const url = options.q ? decodeURIComponent(options.q) : '';
            const urlcode = options.url && decodeURIComponent(options.url) || ''
    // const url = options.q ? decodeURIComponent(options.q) : '';
    // const urlcode = options.url && decodeURIComponent(options.url) || ''
    // #ifdef PUB_CUSTOMER
    if (this.currentInfo.id) {
      let that = this
      setTimeout(() => {
        this.$http.request('get', '/api/customer/center/tj', {}).then(res => {
          if (res.code === 0) {
            that.tj = res.data || {}
          }
        })
      }, 200)
    }
    // #endif
        },
        created() {
plugins/qqmap-wx-jssdk.min.js
对比新文件
@@ -0,0 +1 @@
var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: 'key格式错误', PARAM_ERR: 310, PARAM_ERR_MSG: '请求参数信息有误', SYSTEM_ERR: 600, SYSTEM_ERR_MSG: '系统错误', WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = 'https://apis.map.qq.com/ws/'; var URL_SEARCH = BASE_URL + 'place/v1/search'; var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; var URL_CITY_LIST = BASE_URL + 'district/v1/list'; var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; var URL_DISTANCE = BASE_URL + 'distance/v1/'; var URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, location2query(data) { if (typeof data == 'string') { return data } var query = ''; for (var i = 0; i < data.length; i++) { var d = data[i]; if (!!query) { query += ';' } if (d.location) { query = query + d.location.lat + ',' + d.location.lng } if (d.latitude && d.longitude) { query = query + d.latitude + ',' + d.longitude } } return query }, rad(d) { return d * Math.PI / 180.0 }, getEndLocation(location) { var to = location.split(';'); var endLocation = []; for (var i = 0; i < to.length; i++) { endLocation.push({ lat: parseFloat(to[i].split(',')[0]), lng: parseFloat(to[i].split(',')[1]) }) } return endLocation }, getDistance(latFrom, lngFrom, latTo, lngTo) { var radLatFrom = this.rad(latFrom); var radLatTo = this.rad(latTo); var a = radLatFrom - radLatTo; var b = this.rad(lngFrom) - this.rad(lngTo); var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); distance = distance * EARTH_RADIUS; distance = Math.round(distance * 10000) / 10000; return parseFloat(distance.toFixed(0)) }, getWXLocation(success, fail, complete) { wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) }, getLocationParam(location) { if (typeof location == 'string') { var locationArr = location.split(','); if (locationArr.length === 2) { location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } } else { location = {} } } return location }, polyfillParam(param) { param.success = param.success || function () { }; param.fail = param.fail || function () { }; param.complete = param.complete || function () { } }, checkParamKeyEmpty(param, key) { if (!param[key]) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误'); param.fail(errconf); param.complete(errconf); return true } return false }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, checkLocation(param) { var location = this.getLocationParam(param.location); if (!location || !location.latitude || !location.longitude) { var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); param.fail(errconf); param.complete(errconf); return false } return true }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, handleData(param, data, feature) { if (feature == 'search') { var searchResult = data.data; var searchSimplify = []; for (var i = 0; i < searchResult.length; i++) { searchSimplify.push({ id: searchResult[i].id || null, title: searchResult[i].title || null, latitude: searchResult[i].location && searchResult[i].location.lat || null, longitude: searchResult[i].location && searchResult[i].location.lng || null, address: searchResult[i].address || null, category: searchResult[i].category || null, tel: searchResult[i].tel || null, adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, province: searchResult[i].ad_info && searchResult[i].ad_info.province || null }) } param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) } else if (feature == 'suggest') { var suggestResult = data.data; var suggestSimplify = []; for (var i = 0; i < suggestResult.length; i++) { suggestSimplify.push({ adcode: suggestResult[i].adcode || null, address: suggestResult[i].address || null, category: suggestResult[i].category || null, city: suggestResult[i].city || null, district: suggestResult[i].district || null, id: suggestResult[i].id || null, latitude: suggestResult[i].location && suggestResult[i].location.lat || null, longitude: suggestResult[i].location && suggestResult[i].location.lng || null, province: suggestResult[i].province || null, title: suggestResult[i].title || null, type: suggestResult[i].type || null }) } param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) } else if (feature == 'reverseGeocoder') { var reverseGeocoderResult = data.result; var reverseGeocoderSimplify = { address: reverseGeocoderResult.address || null, latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null }; if (reverseGeocoderResult.pois) { var pois = reverseGeocoderResult.pois; var poisSimplify = []; for (var i = 0; i < pois.length; i++) { poisSimplify.push({ id: pois[i].id || null, title: pois[i].title || null, latitude: pois[i].location && pois[i].location.lat || null, longitude: pois[i].location && pois[i].location.lng || null, address: pois[i].address || null, category: pois[i].category || null, adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, city: pois[i].ad_info && pois[i].ad_info.city || null, district: pois[i].ad_info && pois[i].ad_info.district || null, province: pois[i].ad_info && pois[i].ad_info.province || null }) } param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify, pois: pois, poisSimplify: poisSimplify }) } else { param.success(data, { reverseGeocoderResult: reverseGeocoderResult, reverseGeocoderSimplify: reverseGeocoderSimplify }) } } else if (feature == 'geocoder') { var geocoderResult = data.result; var geocoderSimplify = { title: geocoderResult.title || null, latitude: geocoderResult.location && geocoderResult.location.lat || null, longitude: geocoderResult.location && geocoderResult.location.lng || null, adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, province: geocoderResult.address_components && geocoderResult.address_components.province || null, city: geocoderResult.address_components && geocoderResult.address_components.city || null, district: geocoderResult.address_components && geocoderResult.address_components.district || null, street: geocoderResult.address_components && geocoderResult.address_components.street || null, street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, level: geocoderResult.level || null }; param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) } else if (feature == 'getCityList') { var provinceResult = data.result[0]; var cityResult = data.result[1]; var districtResult = data.result[2]; param.success(data, { provinceResult: provinceResult, cityResult: cityResult, districtResult: districtResult }) } else if (feature == 'getDistrictByCityId') { var districtByCity = data.result[0]; param.success(data, districtByCity) } else if (feature == 'calculateDistance') { var calculateDistanceResult = data.result.elements; var distance = []; for (var i = 0; i < calculateDistanceResult.length; i++) { distance.push(calculateDistanceResult[i].distance) } param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) } else if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, buildWxRequestConfig(param, options, feature) { var that = this; options.header = { "content-type": "application/json" }; options.method = 'GET'; options.success = function (res) { var data = res.data; if (data.status === 0) { that.handleData(param, data, feature) } else { param.fail(data) } }; options.fail = function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; options.complete = function (res) { var statusCode = +res.statusCode; switch (statusCode) { case ERROR_CONF.WX_ERR_CODE: { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); break } case ERROR_CONF.WX_OK_CODE: { var data = res.data; if (data.status === 0) { param.complete(data) } else { param.complete(that.buildErrorConfig(data.status, data.message)) } break } default: { param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } } }; return options }, locationProcess(param, locationsuccess, locationfail, locationcomplete) { var that = this; locationfail = locationfail || function (res) { res.statusCode = ERROR_CONF.WX_ERR_CODE; param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) }; locationcomplete = locationcomplete || function (res) { if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) } }; if (!param.location) { that.getWXLocation(locationsuccess, locationfail, locationcomplete) } else if (that.checkLocation(param)) { var location = Utils.getLocationParam(param.location); locationsuccess(location) } } }; class QQMapWX { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; search(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, orderby: options.orderby || '_distance', page_size: options.page_size || 10, page_index: options.page_index || 1, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } var distance = options.distance || "1000"; var auto_extend = options.auto_extend || 1; var region = null; var rectangle = null; if (options.region) { region = options.region } if (options.rectangle) { rectangle = options.rectangle } var locationsuccess = function (result) { if (region && !rectangle) { requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; getSuggestion(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (!Utils.checkKeyword(options)) { return } var requestParam = { keyword: options.keyword, region: options.region || '全国', region_fix: options.region_fix || 0, policy: options.policy || 0, page_size: options.page_size || 10, page_index: options.page_index || 1, get_subpois: options.get_subpois || 0, output: 'json', key: that.key }; if (options.address_format) { requestParam.address_format = options.address_format } if (options.filter) { requestParam.filter = options.filter } if (options.location) { var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { coord_type: options.coord_type || 5, get_poi: options.get_poi || 0, output: 'json', key: that.key }; if (options.poi_options) { requestParam.poi_options = options.poi_options } var locationsuccess = function (result) { requestParam.location = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; geocoder(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'address')) { return } var requestParam = { address: options.address, output: 'json', key: that.key }; if (options.region) { requestParam.region = options.region } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; getDistrictByCityId(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'id')) { return } var requestParam = { id: options.id || '', output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; calculateDistance(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { mode: options.mode || 'walking', to: Utils.location2query(options.to), output: 'json', key: that.key }; if (options.from) { options.location = options.from } if (requestParam.mode == 'straight') { var locationsuccess = function (result) { var locationTo = Utils.getEndLocation(requestParam.to); var data = { message: "query ok", result: { elements: [] }, status: 0 }; for (var i = 0; i < locationTo.length; i++) { data.result.elements.push({ distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), duration: 0, from: { lat: result.latitude, lng: result.longitude }, to: { lat: locationTo[i].lat, lng: locationTo[i].lng } }) } var calculateResult = data.result.elements; var distanceResult = []; for (var i = 0; i < calculateResult.length; i++) { distanceResult.push(calculateResult[i].distance) } return options.success(data, { calculateResult: calculateResult, distanceResult: distanceResult }) }; Utils.locationProcess(options, locationsuccess) } else { var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX;
static/common/icon-dp.png
store/index.js
@@ -28,6 +28,7 @@
            'info': 0,
            'flower': 0,
            'shopping': 0,
            'follow': 0
        },
        defaultaddress: {}
    },
sub_pages/customer/self/collect.vue
@@ -82,6 +82,8 @@
  },
  onLoad() {
    this.listApi = '/api/collect/list'
    this.getList()
    this.$http.request('get', '/api/code/value', {
      params: {
        type: 'FLOWER_LEVEL'
sub_pages/customer/self/follow.vue
@@ -1,29 +1,127 @@
<template>
    <view>
  <view class="follow-page">
    <view class="follow-item m-b-40" v-for="(item,index) of list" :key="index">
      <image class="avatar img100" :src="item.avatar" mode="aspectFill"></image>
      <view class="info">
        <view class="name">{{ item.supplierName }}</view>
        <view class="time">{{ item.createTime }}</view>
      </view>
      <view class="m-l-a m-r-0 flex">
        <view class="button button-1" @click="clearFollow(item)">取消关注</view>
        <view class="button button-2" @click="toDetail(item)">进店</view>
      </view>
    </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
            }
    return {}
        },
        async onPullDownRefresh() {
            await this.refreshList()
            uni.stopPullDownRefresh()
        },
        onLoad(){
  async onShow() {
    if (this.sign['follow']) {
      await this.$store.dispatch('sign_clear', 'follow');
      this.refreshList()
    }
  },
  async onLoad() {
    await this.$store.dispatch('sign_clear', 'follow');
            this.listApi = '/api/follow/list'
    this.getList()
        },
        methods: {
    toDetail(item) {
      uni.navigateTo({
        url: '/sub_pages/customer/shop/shop?id=' + (item.id || '')
      })
    },
    clearFollow(item) {
      this.$message.showLoading()
      // var res;
      // if(type){
      //   res = await this.$http.request('post',`/api/follow/add`,{
      //     data:{
      //       supplierId:this.dto.supplierId || this.dto.id
      //     }
      //   })
      // }else{
      //   res = await this.$http.request('get',`/api/follow/add`,{
      //     data:{
      //       supplierId:this.dto.supplierId || this.dto.id
      //     }
      //   })
      // }
      this.$message.hideLoading()
      if (code === 0) {
        //删除list里的本元素
        for (var i = 0; i < this.list.length; i++) {
          if (this.list[i].id === item.id) {
            this.list.splice(i, 1)
          }
        }
      }
    },
    getList_after() {
      // uni.
    }
        }
    }
</script>
<style>
<style lang="scss" scoped>
.follow-page {
  .follow-item {
    .avatar {
      width: 114rpx;
      height: 114rpx;
      border: 2rpx solid #FFFFFF;
      border-radius: 50%;
      margin-right: 10rpx;
    }
    .info {
      .name {
        font-weight: 600;
        font-size: 36rpx;
        color: #000000;
        line-height: 50rpx;
      }
      .time {
        font-weight: 400;
        font-size: 28rpx;
        color: #666666;
        line-height: 40rpx;
      }
    }
    .button {
      padding: 14rpx 36rpx;
      text-align: center;
      margin-left: 10rpx;
      font-weight: 400;
      font-size: 24rpx;
      line-height: 60rpx;
    }
    .button-1 {
      color: #999999;
      border-radius: 34rpx;
      border: 2rpx solid #999999;
    }
    .button-2 {
      border-radius: 34rpx;
      border: 2rpx solid #20613D
      color: #20613D;
    }
  }
}
</style>
sub_pages/customer/shop/shop.vue
@@ -19,8 +19,8 @@
                        <view class="store-address">云南省-昆明市-官渡区</view>
                    </view>
                    <view class="store-sc m-l-a m-r-0">
                        <image src="../../../static/icon-gz-1.png" class="icon" v-if="dto.gz"></image>
                        <image src="../../../static/icon-gz-0.png" class="icon" v-if="!dto.gz"></image>
                        <image src="../../../static/icon-gz-1.png" class="icon" v-if="dto.gz" @click="updateGz(false)"></image>
                        <image src="../../../static/icon-gz-0.png" class="icon" v-if="!dto.gz" @click="updateGz(true)"></image>
                        关注
                    </view>
                </view>
@@ -48,7 +48,7 @@
            </top-tabs>
        </view>
        <view class="brand-info">
            <view v-if="flg=='0'" class="brand-info-0">
            <view v-if="flg==='0'" class="brand-info-0">
                <view class="component-filter-container" style="padding-top: 12rpx;">
                    <view class="flex1">
                        排序<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
@@ -110,10 +110,10 @@
            </view>
            <view v-if="flg=='1'" class="brand-info-1">
            <view v-if="flg==='1'" class="brand-info-1">
                <trade :hidefooter="true"></trade>
            </view>
            <view v-if="flg=='3'" class="brand-info-3">
            <view v-if="flg==='2'" class="brand-info-3">
                <view class="title">
                    基础信息
                </view>
@@ -149,9 +149,9 @@
                    {
                        name: '分类'
                    },
                    {
                        name: '评价'
                    },
                    // {
                    //     name: '评价'
                    // },
                    {
                        name: '商家'
                    },
@@ -161,6 +161,31 @@
            }
        },
        methods: {
      //update 关注
      async updateGz(type){
        this.$message.showLoading()
        // var res;
        // if(type){
        //   res = await this.$http.request('post',`/api/follow/add`,{
        //     data:{
        //       supplierId:this.dto.supplierId || this.dto.id
        //     }
        //   })
        // }else{
        //   res = await this.$http.request('get',`/api/follow/add`,{
        //     data:{
        //       supplierId:this.dto.supplierId || this.dto.id
        //     }
        //   })
        // }
        this.$message.hideLoading()
        if(code===0){
          this.dto.gz = !this.dto.gz
          await this.$store.dispatch('sign_add', 'follow')
        }
      },
            changeTab(flg) {
                this.flg = flg
                //如果没有加载数据,需要加载一下
sub_pages/customer/shopping/confirm.vue
@@ -11,6 +11,7 @@
        return state.defaultaddress || {}
      },
    }),
  },
  watch: {
    // address(nv, ov) {
@@ -49,22 +50,76 @@
    //   private List<FlowerCartListDTO> flowers;
    // @ApiModelProperty(value = "打包费")
    //   private BigDecimal packing;
    //todo 显示打包费等,然后再确认
    // https://lanhuapp.com/web/#/item/project/detailDetach?pid=05830e81-7c59-4655-8253-4deb7c913b51&project_id=05830e81-7c59-4655-8253-4deb7c913b51&image_id=f7cc3e57-5367-4b99-a84e-99c38249aa66&fromEditor=true
  },
  data() {
    return {
      dto: {},
      dto: {
        remarks: '',
        specialNeeds: '',
        transportId: '',
        addressId: '',
        flowers: [],
      },
      cacheAddressId: '',
      transportList: [],
      // private Long id;
      // @ApiModelProperty(value = "名称")
      // private String name;
      // @ApiModelProperty(value = "英文名")
      // private String enName;
      // @ApiModelProperty(value = "运费")
      // private BigDecimal fee;
    }
  },
  methods: {
    async submitOrder() {
      if (!this.dto.transportId) {
        this.$message.toast('请选择配送方式')
        return
      }
      if (!this.dto.addressId) {
        this.$message.toast('请选择收货地址')
        return
      }
      this.$message.showLoading()
      const {code, data} = await this.$http.request('post', '/api/customer/flower/order/confirm', {
        data: {
          ...this.dto
        }
      })
      this.$message.hideLoading()
      if (code === 0) {
        //提交信息
        console.log('pay,', data)
        if (data && data['_testOrderId']) {
          //回调
          this.$message.showLoading()
          const {code, data} = await this.$http.request('get', '/api/customer/flower/order/callback/tmp', {
            params: {
              id: data['_testOrderId']
            }
          })
          this.$message.hideLoading()
        } else if (data) {
          //微信接口
          let that = this
          wx.requestPayment({
            ...data,
            async success(res) {
              console.log('pay success', res)
              this.$message.showToast('支付成功')
              //返回上一页
              await this.$store.dispatch('sign_add', 'shopping')
              uni.navigateBack()
              // uni.navigateTo({
              //   url: '/pages/canteen/canteen-success/canteen-success'
              // })
            },
            fail(err) {
              console.error('pay fail', err)
              that.$message.showToast('支付失败')
            }
          })
        }
      }
    }
  }
}
@@ -72,17 +127,86 @@
<template>
  <view class="page-confirm">
    <view>
    <view class="p10">
      <common-address-select ref="addressselect"></common-address-select>
    </view>
    <view>
<!--     todo 查看商品列表,和选择运费 -->
      <view class="flower-container">
        <view class="shopping-item m-t-20" v-for="(item,index) of dto.flowers" :key="index">
          <u-divider v-if="index>0"></u-divider>
          <view class="sup-title">
            <image class="icon-dp" src="/static/common/icon-dp.png"></image>
            {{ item.supplierName || '-' }}
          </view>
          <view class="item-each flex">
            <image class="img img100 m-r-6" :src="item.url||item.cover"></image>
            <view>
              <view class="title"><span>{{ item.levelStr || '-' }}</span>&nbsp;&nbsp;{{ item.name || '-' }}</view>
              <view class="price">
                {{ item.price || 0 }}*{{ item.num }}扎
              </view>
              <view class="desc m-t-12">
                <view class="m-r-15">每扎重量:{{ item.weight || 0 }}</view>
              </view>
            </view>
          </view>
        </view>
        <view class="price">
          <view class="desc">打包费用:{{ dto.packing || 0 }}}</view>
          <view class="m-l-a m-r-0">
            共{{ dto.flowers.length }}件,小计<span class="t-red">¥{{ dto.totalAmount || 0 }}</span>
          </view>
        </view>
      </view>
      <!--    查看商品列表,和选择运费 -->
      <view class="transform-container p10">
        <view class="title flex">
          <view>运输方式:</view>
          <!--          <view>约</view>-->
          <view class="flex transform-list">
            <view v-for="(transform,index) of transportList" :class="[transform.id===dto.transportId?'cur':'']"
                  :key="index" class="transform-item" @click="dto.transportId = transform.id">
              <view class="title">{{ transform.name }}</view>
              <view class="price">¥{{ transform.fee }}</view>
            </view>
          </view>
        </view>
        <view class="m-t-20" v-if="false">
          <view class="desc-red">
            10kg以下的零买订单将收取打包费,花店建议购满20kg, 可选冷链物流
          </view>
          <view class="desc">
            预计装1Mini件,运费约18.00元(5公斤内18元,不满5公斤按5公斤计费,每件货不能超过5公斤),第一汤下单预计次日凌晨发货,备货高峰期除外,冷链汽车运输,发货后72小时左右到货,三线城市会推迟6-12小时,顺丰送货到店。
            优势:价格便宜,顺丰配送
            弊端:订单必须是5kg以内
          </view>
        </view>
      </view>
      <view class="form-item p10">
        <view class="label">特殊需求</view>
        <view class="m-l-a m-r-0 flex text-right">
          <u-textarea v-model="dto.remarks" placeholder="请输入特殊需求">
          </u-textarea>
        </view>
      </view>
      <view class="form-item p10">
        <view class="label">留言</view>
        <view class="m-l-a m-r-0 flex text-right">
          <u-textarea v-model="dto.remarks" placeholder="填写内容需与卖家协商并确认">
          </u-textarea>
        </view>
      </view>
    </view>
    <view class="bottom-price flex">
      <view>
        合计:¥ {{ dto.totalAmount||0 }} 元
      </view>
      <view class="button-green-1">
      <view class="button-green-1" @click="submitOrder">
        提交订单
      </view>
    </view>
@@ -91,6 +215,100 @@
<style scoped lang="scss">
.page-confirm{
  .flower-container {
    .shopping-item {
      padding: 28rpx 22rpx;
      position: relative;
      .sup-title {
        border-bottom: 2rpx solid #EEEEEE;
      }
      .item-each {
        padding-left: 88rpx;
        .img {
          width: 124rpx;
          height: 124rpx;
        }
        .title {
          font-weight: 600;
          font-size: 28rpx;
          color: #000000;
          line-height: 40rpx;
          .level {
            color: #20613D;
          }
        }
        .price {
          font-weight: 400;
          font-size: 28rpx;
          color: #CF0000;
          line-height: 40rpx;
        }
        .desc {
          font-weight: 400;
          font-size: 24rpx;
          color: #666666;
          line-height: 34rpx;
        }
      }
      .button-icons {
        position: absolute;
      }
    }
  }
  .transform-container {
    .transform-list {
      .transform-item {
        background: rgba(225, 240, 231, 0.38);
        border-radius: 8rpx;
        min-height: 112rpx;
        border: 2rpx solid rgba(225, 240, 231, 0.38);
        padding: 14rpx;
        text-align: center;
        margin: 0 auto;
        max-width: 32%;
        .title {
          font-weight: 400;
          font-size: 28rpx;
          color: #000000;
          line-height: 40rpx;
        }
        .price {
          font-weight: 600;
          font-size: 32rpx;
          color: #20613D;
          line-height: 44rpx;
        }
      }
      .transform-item.cur {
        background: #E1F0E7;
        border-radius: 8rpx;
        border: 2rpx solid #20613D;
      }
    }
    .transform-list:nth-child(3n+0) {
      margin-left: 0
    }
    .transform-list:nth-child(3n+2) {
      margin-right: 0;
    }
  }
  .bottom-price {
    position: fixed;
sub_pages/customer/trade/list.vue
@@ -130,6 +130,8 @@
            console.log('options', options)
            this.query.category = options.categoryId || ''
            this.listApi = '/api/customer/flower/list'
      this.getList()
            // await this.getList('post')
            // this.
        },
sub_pages/supplier/supplier-info/supplier-info.vue
@@ -133,7 +133,7 @@
                </view>
            </view>
            <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
                v-if="dto.idcardType=='身份证'&&dto.idCards&&dto.idCards.length>0">
                v-if="dto.idcardType==='身份证'&&dto.idCards&&dto.idCards.length>0">
                <view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.idCards" :key="index">
                    <image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">
@@ -151,7 +151,7 @@
                </view>
            </view>
            <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
                v-if="dto.idcardType=='营业执照'&&dto.pictures&&dto.pictures.length>0">
                v-if="dto.idcardType==='营业执照'&&dto.pictures&&dto.pictures.length>0">
                <view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.pictures" :key="index">
                    <image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">