1
xuxueyang
2024-07-26 3d1e8016516b1b27def77871c8644be363d4fb88
1
已删除4个文件
已修改6个文件
1044 ■■■■■ 文件已修改
common/airport.js 262 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/html-parser.js 352 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/self_base.js 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
environments/index.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mixin/mixin.js 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modifyManifest.js 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/self/collect.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sub_pages/customer/trade/detail.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/airport.js
文件已删除
common/html-parser.js
文件已删除
common/self_base.js
文件已删除
environments/index.js
@@ -3,12 +3,9 @@
    httpBaseUri: 'https://www.hmyxianhua.com/flower',
    // httpBaseUri: 'http://47.99.58.211/flower',
    // httpBaseUri: 'http://localhost:8080/flower',
    clientId: '',
    secret: '',
    tenantId: '',
    appDownloadUri: 'http://xxx/app/',
    websocketUrl: '',
    type: 'dev'
}
main.js
@@ -1,4 +1,4 @@
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import store from './store'
@@ -13,8 +13,8 @@
Vue.prototype.$storage = storage
import util from './plugins/util'
Vue.prototype.$util = util
import self_base from './common/self_base.js'
Vue.use(self_base);
// import self_base from './common/self_base.js'
// Vue.use(self_base);
import mixinsCommon from './mixin/mixin.js'
Vue.mixin(mixinsCommon)
@@ -92,17 +92,3 @@
    ...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
    createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
    const app = createSSRApp(App)
    return {
        app
    }
}
// #endif
mixin/mixin.js
@@ -3,7 +3,7 @@
} from 'vuex'
import store from "../store";
import environments from '@/environments'
// import environments from '@/environments'
const mixinsCommon = {
    computed: {
@@ -46,9 +46,10 @@
                'color': '#fff'
            },
            listApi: '',
            regUserName: '用户-' + this.getRandomName(Math.floor(Math.random() * (6 - 2) + 3)),
            regAvatarUrl: 'https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png',
            // regUserName: '用户-' + this.getRandomName(Math.floor(Math.random() * (6 - 2) + 3)),
            // regAvatarUrl: 'https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png',
            regUserName: '',
            regAvatarUrl: '',
        }
    },
    methods: {
@@ -66,180 +67,9 @@
        onBindinput(e) {
            this.regUserName = e.detail.value; // 获取微信昵称
        },
        randomAccess(min, max) {
            return Math.floor(Math.random() * (min - max) + max)
        },
        getRandomName(NameLength) {
            let name = ""
            for (let i = 0; i < NameLength; i++) {
                let unicodeNum = ""
                unicodeNum = this.randomAccess(0x4e00, 0x9fa5).toString(16)
                name += this.decodeUnicode(unicodeNum)
            }
            return name
        },
        decodeUnicode(str) {
            //Unicode显示方式是\u4e00
            str = "\\u" + str
            str = str.replace(/\\/g, "%");
            //转换中文
            str = unescape(str);
            //将其他受影响的转换回原来
            str = str.replace(/%/g, "\\");
            return str;
        },
        async onWxCheckSubmit() {
            if (this.regUserName == '微信用户') {
                this.$message.showToast('昵称不合规,不可以叫做:微信用户哈~')
                return
            }
            //保存一下
            //先上传图片
            if (this.regAvatarUrl ===
                'https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png') {
                var picture = this.regAvatarUrl
                //更新接口
                this.$message.showLoading()
                const {
                    code
                } = await this.$http.request('post', "/api/current/user/update", {
                    data: {
                        ...this.dto,
                        nickName: this.regUserName,
                        picture: picture
                    }
                })
                this.$message.hideLoading()
                this.$forceUpdate()
                if (code == 0) {
                    this.$refs.popup_info.close()
                    this.$message.showToast('设置成功')
                    this.currentInfo.picture = picture
                    this.currentInfo.nickName = this.regUserName
                } else {
                }
            } else {
                this.$http.upload(this.regAvatarUrl).then(async res => {
                    var picture = res.data && res.data.length > 0 && res.data[0].url || ''
                    //更新接口
                    this.$message.showLoading()
                    const {
                        code
                    } = await this.$http.request('post', "/api/current/user/update", {
                        data: {
                            ...this.currentInfo,
                            nickName: this.regUserName,
                            picture: picture
                        }
                    })
                    this.$message.hideLoading()
                    this.$forceUpdate()
                    if (code == 0) {
                        this.$refs.popup_info.close()
                        this.$message.showToast('设置成功')
                        this.currentInfo.picture = picture
                        this.currentInfo.nickName = this.regUserName
                    } else {
                    }
                })
            }
        },
        async getUserProfile(e) {
            this.$message.showLoading()
            const res = await wx.getUserProfile({
                desc: '用于完善会员资料',
            });
            console.log(res);
            this.$message.hideLoading()
            this.login_Wx(res.userInfo.avatarUrl, res.userInfo.nickName)
        },
        login_Wx(imgurl, nickname) {
            //获取openId
            // /wx/jscode2session
            let inviter = this.$storage.getItem('inviter') || ''
            let inviterName = this.$storage.getItem('inviterName') || ''
            //有效24小时
            if (inviter) {
                var inviterTime = this.$storage.getItem('inviterTime')
                if (new Date().getTime() > parseInt(inviterTime) + 1000 * 3600 * 24) {
                    inviter = ''
                    inviterName = ''
                    this.$storage.removeItem('inviter')
                    this.$storage.removeItem('inviterTime')
                    this.$storage.removeItem('inviterName')
                }
            }
            const tmp = this;
            this.$message.showLoading()
            this.openid = this.$storage.getItem('openid');
            this.tel = this.$storage.getItem('tel');
            console.log('info,info,info,info,info,info', this.openid, this.tel);
            if (!!this.openid && !!this.tel) {
                // this.login = true;
            } else {
                // this.login = false;
                console.log('wx.login');
                wx.login({
                    success: async res => {
                        if (res.code) {
                            //微信登录成功 已拿到code
                            // tmp.login = true;
                            // tmp.jsCode = res.code; //保存获取到的code
                            console.log('abcd', res.code);
                            // this.$http.request('post',`/api/login/wechat`,{data:{code:tmp.jsCode}})
                            this.$storage.setItem('jsCode', res.code);
                            const res2 = await wx.getUserInfo();
                            console.log('res', res2);
                            this.tcode = res.code || ''
                            // if (nickname == '微信用户' || true) {
                            //     //跳出弹出框,获取具体用户信息
                            //     tmp.$message.hideLoading()
                            //     this.$refs.popup_info.open()
                            // } else {
                            await this.$store.dispatch('loginwx', {
                                code: res.code,
                                imgurl: imgurl,
                                nickname: nickname,
                                inviter: inviter
                            });
                            tmp.$message.hideLoading()
                            this.$forceUpdate()
                            //延迟,如果用户昵称是微信用户的话?
                            setTimeout(() => {
                                if (tmp.currentInfo && tmp.currentInfo.id) {
                                    if (tmp.currentInfo.nickName == '微信用户') {
                                        tmp.$refs.popup_info && tmp.$refs.popup_info.open()
                                    }
                                }
                            }, 500)
                            // }
                        } else {
                            tmp.$message.hideLoading()
                            tmp.$message.showToast('微信登录失败');
                        }
                    },
                    error: res => {
                        console.log('wx.login error', res);
                        tmp.$message.hideLoading()
                        tmp.$message.showToast('微信授权失败');
                    }
                });
            }
        },
        previewImg(url) {
            if (url) {
@@ -413,103 +243,8 @@
            }
        }
        // #endif
        // #ifdef MP
        ,
        async wxdownload(url, name = '') {
            await this.$message.confirm('是否要下载此文件')
            var url2 = environments.httpBaseUri + `/api/download/file?fileName=${name}&filePath=` + url
            let that = this
            that.$message.showLoading()
            // wx.sa
            // wx.downloadFile({
            //     url: url2,
            //     success: res => {
            //         that.$message.showToast('下载成功')
            //     },
            //     fail: res => {
            //         that.$message.showToast('下载失败')
            //     },
            //     complete: res => {
            //         that.$message.hideLoading()
            //     }
            // })
            wx.downloadFile({
                url: url,
                timeout: 120000,
                success(res) {
                    that.$message.hideLoading()
                    console.log('res', res)
                    if (res.statusCode === 200) {
                        const filePath = res.tempFilePath
                        if (filePath.endsWith('.jpg') ||
                            filePath.endsWith('.jpeg') ||
                            filePath.endsWith('.png') ||
                            filePath.endsWith('.jpg')) {
                            wx.saveImageToPhotosAlbum({
                                filePath: filePath,
                                success: function (res) {
                                    that.$message.showToast('保存图片成功')
                                },
                                fail: function (res) {
                                    that.$message.showToast('打开文档失败,非支持的类型')
                                }
                            })
                        } else if (filePath.endsWith('.mp4') ||
                            filePath.endsWith('.flv') ||
                            filePath.endsWith('.avi') ||
                            filePath.endsWith('.wmv') ||
                            filePath.endsWith('.mpeg')) {
                            wx.saveVideoToPhotosAlbum({
                                filePath: filePath,
                                success: function (res) {
                                    that.$message.showToast('保存视频成功')
                                },
                                fail: function (res) {
                                    that.$message.showToast('打开文档失败,非支持的类型')
                                }
                            })
                        } else {
                            wx.openDocument({
                                filePath: filePath,
                                showMenu: true, //关键点
                                success: function (res) {
                                    console.log('打开文档成功')
                                },
                                fail: function (res) {
                                    that.$message.showToast('打开文档失败,非支持的类型')
                                }
                            })
                        }
                    } else {
                        that.$message.showToast('下载失败,服务器内部错误')
                    }
                },
                fail: res => {
                    that.$message.hideLoading()
                    that.$message.showToast('下载失败')
                },
                complete: res => {
                }
            })
        }
        // #endif
        // #ifdef PUB_CUSTOMER
        ,
        async submitShopping(dto) {
            //提交到购物车中
            this.$message.showLoading()
            await this.$store.dispatch('submitShopping', dto);
            this.$message.hideLoading()
        }
        // #endif
    }
}
export default mixinsCommon
modifyManifest.js
文件已删除
pages.json
@@ -99,7 +99,9 @@
        "navigationBarTitleText": "订单详情",
        "enablePullDownRefresh": false
      }
    },
    }
    // #ifdef PUB_PARTNER
    ,
    {
      "path": "sub_pages/partner/delivery/delivery",
      "style": {
@@ -114,6 +116,7 @@
        "enablePullDownRefresh": true
      }
    }
    // #endif
  ],
  "subPackages": [
    {
@@ -141,7 +144,7 @@
            "enablePullDownRefresh": false
          }
        },
        // #endif
        {
          "path": "order-settlement/order-settlement",
          "style": {
@@ -164,6 +167,7 @@
            "navigationBarBackgroundColor": "#E6F2EB"
          }
        },
        // #endif
        {
          "path": "protocol",
          "style": {
sub_pages/customer/self/collect.vue
@@ -16,8 +16,7 @@
      </view>
      <view class="flex1" @click.stop="level_show=true">
        {{ this.query.levelStr || '级别' }}
        <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"
        ></image>
                <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
      </view>
    </view>
    <no-data v-if="!list||list.length===0" style="width: 100%;"></no-data>
@@ -76,10 +75,14 @@
        columnStr: '',
      },
      level_show: false,
      level_columns: [[]],
                level_columns: [
                    []
                ],
      order_show: false,
      order_columns: [[]]
                order_columns: [
                    []
                ]
    }
  },
  onLoad() {
@@ -113,6 +116,12 @@
    })
  },
  methods: {
            async submitShopping(dto) {
                //提交到购物车中
                this.$message.showLoading()
                await this.$store.dispatch('submitShopping', dto);
                this.$message.hideLoading()
            },
    select_level(e) {
      this.level_show = false
      this.query.levelStr = e.value[0].label
@@ -154,5 +163,4 @@
    }
  }
}
</style>
sub_pages/customer/trade/detail.vue
@@ -7,7 +7,8 @@
<!--        <view class="num">12</view>-->
      </view>
      <view class="icon-container">
        <image src="../../../static/common/icon-shop.png" @click="submitShopping(dto)" class="icon-shop"></image>
                <image src="../../../static/common/icon-shop.png" @click="submitShopping(dto)" class="icon-shop">
                </image>
      </view>
    </view>
@@ -132,6 +133,12 @@
    }
  },
  methods: {
            async submitShopping(dto) {
                //提交到购物车中
                this.$message.showLoading()
                await this.$store.dispatch('submitShopping', dto);
                this.$message.hideLoading()
            },
    async getDetail() {
      this.$message.showLoading()
      const {
@@ -267,7 +274,8 @@
        line-height: 40rpx;
        .level {
          color: #20613D;;
                        color: #20613D;
                        ;
        }
      }
    }