jinx 2 лет назад
Родитель
Сommit
f1768e7fcc

+ 180 - 69
component/auth/auth.js

@@ -4,75 +4,186 @@ const util = require('../../utils/util.js');
 
 Component({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    show: false,
-    canIUse: wx.canIUse('button.open-type.getUserInfo')
-  },
-  
-  attached() {
-    this.callback = () => {
-      this.setData({show: !getApp().globalData.loginProps.isLogin})
-
-      // let pages = getCurrentPages()
-      // let currPage = pages[pages.length - 1].route
-      // if (currPage === 'pages/discover/discover') {
-      //   this.setData({bottom: '50px'})
-      // } else {
-      //   this.setData({bottom: 0})
-      // }
-    }
-    this.callback()
-    getApp().addLoginListener(this.callback)
-  },
-  detached() {
-    getApp().removeLoginListener(this.callback)
-  },
-  methods: {
-    quitHandle: function() {
-      getApp().setLoginProps(true)
-    },
-    getCode: function() {
-      return new Promise(r => {
-        wx.login({
-          success: function(res) {
-            if (res.code) {
-              r(res.code)
-            }
-          }
-        });
-      })
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        show: false,
+        canIUse: wx.canIUse('button.open-type.getUserInfo')
     },
-    authLogin() {
-      this.triggerEvent('login')
-    },
-    bindGetUserInfo: async function(e) {
-      let code = await this.getCode()
-      //登录远程服务器
-      util.request(api.AuthLoginByWeixin, {
-        code: code,
-        userInfo: e.detail
-      }, 'POST', 'application/json').then(res => {
-        if (res.errno === 0) {
-          //存储用户信息
-          res.data.userInfo.userId = res.data.userId
-          wx.setStorageSync('userInfo', res.data.userInfo);
-          wx.setStorageSync('token', res.data.token);
-          wx.setStorageSync('userId', res.data.userId);
-          wx.setStorageSync('isLogin', true);
-          getApp().setLoginProps(true)
-          this.authLogin()
-        } else {
-          // util.showErrorToast(res.errmsg)
-          // wx.showModal({
-          //   title: '提示',
-          //   content: res.errmsg,
-          //   showCancel: false
-          // });
+
+    attached() {
+        this.callback = () => {
+            this.setData({
+                show: !getApp().globalData.loginProps.isLogin
+            })
+
+            // let pages = getCurrentPages()
+            // let currPage = pages[pages.length - 1].route
+            // if (currPage === 'pages/discover/discover') {
+            //   this.setData({bottom: '50px'})
+            // } else {
+            //   this.setData({bottom: 0})
+            // }
         }
-      });
+        this.callback()
+        getApp().addLoginListener(this.callback)
     },
-  }
-})
+    detached() {
+        getApp().removeLoginListener(this.callback)
+    },
+    methods: {
+        quitHandle: function () {
+            getApp().setLoginProps(true)
+        },
+        getCode: function () {
+            return new Promise(r => {
+                wx.login({
+                    success: function (res) {
+                        if (res.code) {
+                            r(res.code)
+                        }
+                    }
+                });
+            })
+        },
+        authLogin() {
+            this.triggerEvent('login')
+        },
+        //获取用户信息接口
+        getUserProfile: function () {
+            return new Promise((resovle, reject) => {
+                wx.getUserProfile({
+                    desc: "用于完善用户资料",
+                    //异步请求:回调函数中调用下一个函数
+                    success(res) {
+                        resovle(res)
+                    },
+                    fail(err) {
+                        wx.showModal({
+                            title: "登录失败",
+                            content: "网络异常,请重试",
+                        })
+                        reject(err)
+                    },
+                });
+
+            })
+        },
+        bindGetUserInfo: async function (e) {
+
+            // let UserProfile = await this.getUserProfile()
+            let UserProfile ={}
+            console.error(UserProfile)
+            return new Promise(async (resolve, reject) => {
+                let code = await wxLogin()
+
+                UserProfile.code = code
+                // UserProfile.userInfo.signature = UserProfile.signature
+                // UserProfile.userInfo.rawData = UserProfile.rawData
+                // UserProfile.userInfo.encryptedData = UserProfile.encryptedData
+                console.log(UserProfile)
+
+
+
+                util.request(api.AuthLoginByWeixin, UserProfile, 'POST', 'application/json').then(res => {
+                    if (res.errno === 0) {
+                        //存储用户信息
+                        res.data.userInfo.userId = res.data.userId
+                        wx.setStorageSync('userInfo', res.data.userInfo);
+                        wx.setStorageSync('token', res.data.token);
+                        wx.setStorageSync('userId', res.data.userId);
+                        wx.setStorageSync('isLogin', true);
+                        getApp().setLoginProps(true)
+                        this.authLogin()
+                    } else {
+                        // util.showErrorToast(res.errmsg)
+                        // wx.showModal({
+                        //   title: '提示',
+                        //   content: res.errmsg,
+                        //   showCancel: false
+                        // });
+                    }
+                });
+
+                // wx.getUserInfo({
+                //     withCredentials: true,
+                //     success(res) {
+                //         console.log(res)
+
+                //         //登录远程服务器
+                //         util.request(api.AuthLoginByWeixin, UserProfile, 'POST', 'application/json').then(res => {
+                //             if (res.errno === 0) {
+                //                 //存储用户信息
+                //                 res.data.userInfo.userId = res.data.userId
+                //                 wx.setStorageSync('userInfo', res.data.userInfo);
+                //                 wx.setStorageSync('token', res.data.token);
+                //                 wx.setStorageSync('userId', res.data.userId);
+                //                 wx.setStorageSync('isLogin', true);
+                //                 getApp().setLoginProps(true)
+                //                 this.authLogin()
+                //             } else {
+                //                 // util.showErrorToast(res.errmsg)
+                //                 // wx.showModal({
+                //                 //   title: '提示',
+                //                 //   content: res.errmsg,
+                //                 //   showCancel: false
+                //                 // });
+                //             }
+                //         });
+                //     },
+                //     fail(err) {
+                //         wx.hideLoading()
+                //         reject(err)
+                //     }
+                // })
+            })
+
+            // let code = await this.getCode()
+
+            // //登录远程服务器
+            // util.request(api.AuthLoginByWeixin, {
+            //     code: code,
+            //     userInfo: e.detail
+            // }, 'POST', 'application/json').then(res => {
+            //     if (res.errno === 0) {
+            //         //存储用户信息
+            //         res.data.userInfo.userId = res.data.userId
+            //         wx.setStorageSync('userInfo', res.data.userInfo);
+            //         wx.setStorageSync('token', res.data.token);
+            //         wx.setStorageSync('userId', res.data.userId);
+            //         wx.setStorageSync('isLogin', true);
+            //         getApp().setLoginProps(true)
+            //         this.authLogin()
+            //     } else {
+            //         // util.showErrorToast(res.errmsg)
+            //         // wx.showModal({
+            //         //   title: '提示',
+            //         //   content: res.errmsg,
+            //         //   showCancel: false
+            //         // });
+            //     }
+            // });
+        },
+
+
+    }
+})
+
+
+function wxLogin() {
+    return new Promise((resovle, reject) => {
+        wx.login({
+            success(res) {
+                resovle(res.code)
+            },
+            fail(err) {
+                wx.showModal({
+                    title: "登录失败",
+                    content: "网络异常,请重试",
+                })
+                reject(err)
+            },
+        })
+    })
+}

+ 2 - 2
component/auth/auth.wxml

@@ -14,7 +14,7 @@
           </cover-view>
         </cover-view>
       </cover-view>
-
-      <button class="button" wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">允许使用</button>
+      <button class="button" wx:if="{{canIUse}}"  bindtap="bindGetUserInfo">允许使用</button>
+      <!-- <button class="button" wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">允许使用</button> -->
     </cover-view>
 </view>

+ 4 - 2
config.js

@@ -1,6 +1,8 @@
 const dev = {
   socketHost: 'wss://testshop.4dkankan.com',
+//   requestHost: 'https://testshop.4dkankan.com',
   requestHost: 'https://testshop.4dkankan.com',
+//   requestHost: 'http://192.168.0.152:8080',
   // 容器地址
   // viewHost: 'http://192.168.0.112:8081',
   // 发现地址
@@ -16,5 +18,5 @@ const mal = {
 }
 
 
-export default dev
-// export default mal
+// export default dev
+export default mal

+ 1 - 1
pages/ucenter/index/index.js

@@ -153,7 +153,7 @@ Page({
       this.setData({
         userInfo: {
           nickName: data.nickname,
-          avatarUrl: data.avatar,
+          avatarUrl: data.avatar || 'https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150547696d798c.png',
         }
       })
     },

+ 4 - 3
pages/user/imageCropper.js

@@ -39,21 +39,22 @@ Page({
    */
   getImg() {
     //调用函数说明中的getImg得到wx图片临时路径res.url
-    this.cropper.getImg(res => {
-      console.log(res)
+    this.cropper.getImg(data => {
+
       wx.showLoading({
         title: '上传中...',
         mask: true
       })
       //上传图片至FastDFS
       wx.uploadFile({
-        filePath: res.url,
+        filePath: data.url,
         name: 'file',
         url: api.UploadFile,
         header: {
           'X-Nideshop-Token': wx.getStorageSync('token')
         },
         success: (res) => {
+            console.log(res)
           var data = JSON.parse(res.data);
 
           console.log(data)

+ 160 - 126
pages/user/user.js

@@ -5,141 +5,175 @@ const util = require('../../utils/util.js');
 
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    birthday: '',
-    region: [],
-    customItem: '全部',
-    gender: 0
-  },
-
-  updateNickName(ev) {
-    this.setData({nickname: ev.detail.value})
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    this.getUserInfo()
-    let userInfo = wx.getStorageSync('userInfo')
-    userInfo.avatar = userInfo.avatarUrl
-    delete userInfo.avatarUrl
-
-    this.setData({ ...userInfo })
-  },
-
-
-  loginSuccess() {
-    this.onLoad()
-  },
-  async getUserInfo() {
-    const {data} = await util.request(api.UserInfo)
-    data.region = data.city ? data.city.split(',') : []
-    data.birthday = data.birthday || '1990-01-01'
-    this.setData({
-      ...data
-    })
-  },
-
-  updateSex(e) {
-    this.setData({gender: e.currentTarget.dataset.sex})
-  },
-
-  bindDateChange(e) {
-    this.setData({ birthday: e.detail.value })
-  },
-
-  bindRegionChange (e) {
-    this.setData({ region: e.detail.value })
-  },
-
-  selectPhoto() {
-    wx.chooseImage({
-      count: 1,
-      sizeType: 'compressed',
-      success: (res) => {
-        const src = res.tempFilePaths[0]
-        // this.file = res.tempFiles[0]
-        wx.navigateTo({
-          url: './imageCropper?image=' + src,
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        birthday: '',
+        region: [],
+        customItem: '全部',
+        gender: 0
+    },
+
+    updateNickName(ev) {
+        this.setData({
+            nickname: ev.detail.value
         })
-        // this.setData({ avatar: src })
-      }
-    })
-  },
-
-  async save() {
-    console.log(this.file)
-    if (this.file) {
-      let avatar = await (new Promise(r => {
-        wx.uploadFile({
-          filePath: this.data.avatar,
-          name: 'file',
-          url: api.UploadFile,
-          header: {'X-Nideshop-Token': wx.getStorageSync('token')},
-          success: (res) => {
-            this.file = null
-            r(JSON.parse(res.data).data)
-          }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.getUserInfo()
+        let userInfo = wx.getStorageSync('userInfo')
+        userInfo.avatar = userInfo.avatarUrl || 'https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150547696d798c.png'
+        delete userInfo.avatarUrl
+
+        this.setData({
+            ...userInfo
         })
-      }));
-
-      this.data.avatar = avatar
-    }
-
-    this.data.city = this.data.region && this.data.region.join(',')
-    const body = {...this.data}
-    delete body.region
-    const {data} = await util.request(api.UpdateUserInfo, body, 'POST', 'application/json')
-    wx.navigateBack()
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
+    },
+
+
+    loginSuccess() {
+        this.onLoad()
+    },
+    async getUserInfo() {
+        const {
+            data
+        } = await util.request(api.UserInfo)
+        data.region = data.city ? data.city.split(',') : []
+        data.birthday = data.birthday || '1990-01-01'
+        if (!data.avatar) {
+            data.avatar = 'https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150547696d798c.png'
+        }
+        this.setData({
+            ...data
+        })
+    },
 
-  },
+    updateSex(e) {
+        this.setData({
+            gender: e.currentTarget.dataset.sex
+        })
+    },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
+    bindDateChange(e) {
+        this.setData({
+            birthday: e.detail.value
+        })
+    },
 
-  },
+    bindRegionChange(e) {
+        this.setData({
+            region: e.detail.value
+        })
+    },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
+    selectPhoto(e) {
 
-  },
+        const {
+            avatarUrl
+        } = e.detail
+        console.error(e)
+        console.log(avatarUrl)
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
+        wx.navigateTo({
+            url: './imageCropper?image=' + avatarUrl,
+        })
 
-  },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
+        //   console.log( e)
+        //   console.log( e.detail)
+        // wx.chooseImage({
+        //   count: 1,
+        //   sizeType: 'compressed',
+        //   success: (res) => {
+        //     const src = res.tempFilePaths[0]
+        //     // this.file = res.tempFiles[0]
+        //     wx.navigateTo({
+        //       url: './imageCropper?image=' + src,
+        //     })
+        //     // this.setData({ avatar: src })
+        //   }
+        // })
+    },
+
+    async save() {
+        console.log(this.file)
+        if (this.file) {
+            let avatar = await (new Promise(r => {
+                wx.uploadFile({
+                    filePath: this.data.avatar,
+                    name: 'file',
+                    url: api.UploadFile,
+                    header: {
+                        'X-Nideshop-Token': wx.getStorageSync('token')
+                    },
+                    success: (res) => {
+                        this.file = null
+                        r(JSON.parse(res.data).data)
+                    }
+                })
+            }));
+
+            this.data.avatar = avatar
+        }
+
+        this.data.city = this.data.region && this.data.region.join(',')
+        const body = {
+            ...this.data
+        }
+        delete body.region
+        const {
+            data
+        } = await util.request(api.UpdateUserInfo, body, 'POST', 'application/json')
+        wx.navigateBack()
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {},
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
 
-  }
+    }
 })

+ 56 - 53
pages/user/user.wxml

@@ -1,62 +1,65 @@
 <view>
-	<auth bindlogin="loginSuccess" />
-  <view class="photo">
-    <view class="userinfo-avatar" bindtap="selectPhoto" style="background-image: url({{avatar}})">
+    <auth bindlogin="loginSuccess" />
+    <view class="photo">
+        <button class="userinfo-avatar" open-type="chooseAvatar" bind:chooseavatar="selectPhoto">
+            <!-- <view  bindtap="selectPhoto" style="background-image: url({{avatar}})"> -->
+            <view style="background-image: url({{avatar }})">
+            </view>
+        </button>
+        <text class="userinfo-nickname">点击修改头像</text>
+        <!-- {{userInfo.nickName}} -->
     </view>
-    <text class="userinfo-nickname">点击修改头像</text>
-    <!-- {{userInfo.nickName}} -->
-  </view>
 
-  <view class="info">
-    <view class="item">
-      <text>用户昵称</text>
-      <view class="ir">
-        <input value="{{nickname}}" class="ipname" bindinput="updateNickName"></input>
-      </view>
-    </view>
-    <view class="item">
-      <text>性别</text>
-      <view class="ir radio">
-        <view class="checkbox" bindtap="updateSex" data-sex="{{1}}">
-          <image src="{{gender === 1 ?  '/static/images/icon-normal_checkbox-checked.png' :'/static/images/icon-normal_checkbox.png' }}" ></image>
-          男
+    <view class="info">
+        <view class="item">
+            <text>用户昵称</text>
+            <view class="ir">
+                <input type="nickname" value="{{nickname}}" class="ipname" bindinput="updateNickName"></input>
+            </view>
         </view>
-        <view class="checkbox" bindtap="updateSex" data-sex="{{0}}">
-          <image src="{{gender === 0 ?  '/static/images/icon-normal_checkbox-checked.png' :'/static/images/icon-normal_checkbox.png' }}" ></image>
-          女
+        <view class="item">
+            <text>性别</text>
+            <view class="ir radio">
+                <view class="checkbox" bindtap="updateSex" data-sex="{{1}}">
+                    <image src="{{gender === 1 ?  '/static/images/icon-normal_checkbox-checked.png' :'/static/images/icon-normal_checkbox.png' }}"></image>
+                    男
+                </view>
+                <view class="checkbox" bindtap="updateSex" data-sex="{{0}}">
+                    <image src="{{gender === 0 ?  '/static/images/icon-normal_checkbox-checked.png' :'/static/images/icon-normal_checkbox.png' }}"></image>
+                    女
+                </view>
+            </view>
         </view>
-      </view>
-    </view>
-    
-    <view class="item">
-      <text>生日</text>
-      <view class="ir">
-        <picker bindchange="bindDateChange" mode="date" value="{{birthday}}">
-          <view class="picker-date">
-            {{birthday ? birthday : ''}}
-            <image src="/static/images/go.png"></image>
-          </view>
-        </picker>
-      </view>
-    </view>
 
-    <view class="item">
-      <text>城市</text>
-      <view class="ir">
-        <picker bindchange="bindRegionChange" mode="region" value="{{region}}" >
-          <view class="picker-date">
-            <block wx:if="{{region.length}}">
-              {{region[0]}},{{region[1]}},{{region[2]}}  
-            </block>
-            <image src="/static/images/go.png"></image>
-          </view>
-        </picker>
-      </view>
-    </view>
+        <view class="item">
+            <text>生日</text>
+            <view class="ir">
+                <picker bindchange="bindDateChange" mode="date" value="{{birthday}}">
+                    <view class="picker-date">
+                        {{birthday ? birthday : ''}}
+                        <image src="/static/images/go.png"></image>
+                    </view>
+                </picker>
+            </view>
+        </view>
 
-  </view>
+        <view class="item">
+            <text>城市</text>
+            <view class="ir">
+                <picker bindchange="bindRegionChange" mode="region" value="{{region}}">
+                    <view class="picker-date">
+                        <block wx:if="{{region.length}}">
+                            {{region[0]}},{{region[1]}},{{region[2]}}
+                        </block>
+                        <image src="/static/images/go.png"></image>
+                    </view>
+                </picker>
+            </view>
+        </view>
+
+    </view>
 
-  <view class="save">
-    <button bindtap="save">保存</button>
-  </view>
+    <view class="save">
+        <button bindtap="save">保存</button>
+    </view>
 </view>

+ 7 - 2
pages/user/user.wxss

@@ -16,9 +16,14 @@ page {
   border-radius: 50%;
   overflow: hidden;
   margin: 0 auto;
-  background-size: 80px 80px;
-}
+  padding: 0;
 
+}
+.userinfo-avatar view{
+    width: 100%;
+    height: 100%;
+    background-size: 80px 80px;
+}
 
 .userinfo-nickname {
   text-align: center;

+ 205 - 384
project.config.json

@@ -1,385 +1,206 @@
-{
-    "description": "项目配置文件。",
-    "setting": {
-<<<<<<< HEAD
-        "urlCheck": true,
-=======
-        "urlCheck": false,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-        "es6": true,
-        "enhance": true,
-        "postcss": true,
-        "preloadBackgroundData": false,
-        "minified": true,
-        "newFeature": true,
-        "coverView": true,
-<<<<<<< HEAD
-        "nodeModules": true,
-=======
-        "nodeModules": false,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-        "autoAudits": false,
-        "showShadowRootInWxmlPanel": true,
-        "scopeDataCheck": false,
-        "uglifyFileName": false,
-        "checkInvalidKey": true,
-        "checkSiteMap": true,
-        "uploadWithSourceMap": true,
-        "compileHotReLoad": false,
-        "lazyloadPlaceholderEnable": false,
-        "useMultiFrameRuntime": true,
-        "useApiHook": true,
-        "useApiHostProcess": true,
-        "babelSetting": {
-            "ignore": [],
-            "disablePlugins": [],
-            "outputPath": ""
-        },
-        "enableEngineNative": false,
-        "useIsolateContext": false,
-        "userConfirmedBundleSwitch": false,
-        "packNpmManually": false,
-        "packNpmRelationList": [],
-        "minifyWXSS": true,
-        "disableUseStrict": false,
-<<<<<<< HEAD
-        "minifyWXML": true,
-        "showES6CompileOption": false,
-        "useCompilerPlugins": false,
-        "condition": false
-=======
-        "showES6CompileOption": false,
-        "useCompilerPlugins": false,
-        "minifyWXML": true
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-    },
-    "compileType": "miniprogram",
-    "libVersion": "2.6.6",
-    "appid": "wx0509bd21546d1597",
-    "projectname": "FDshop",
-    "simulatorType": "wechat",
-    "simulatorPluginLibVersion": {},
-    "condition": {
-<<<<<<< HEAD
-        "miniprogram": {
-            "list": [
-                {
-=======
-        "search": {
-            "list": []
-        },
-        "conversation": {
-            "list": []
-        },
-        "plugin": {
-            "list": []
-        },
-        "game": {
-            "list": []
-        },
-        "gamePlugin": {
-            "list": []
-        },
-        "miniprogram": {
-            "list": [
-                {
-                    "id": 0,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "选择优惠券",
-                    "pathName": "pages/shopping/selCoupon/selCoupon",
-                    "query": "isBuy=false"
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "订单界面",
-                    "pathName": "pages/shopping/checkout/checkout",
-                    "query": "isBuy=true"
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "我的优惠券",
-                    "pathName": "pages/ucenter/coupon/coupon",
-                    "query": "isBuy=true"
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "我的订单",
-                    "pathName": "pages/ucenter/order/order",
-                    "query": ""
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": 4,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/goods/goods",
-                    "pathName": "pages/goods/goods",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/index/index",
-                    "pathName": "pages/ucenter/index/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/cart/cart",
-                    "pathName": "pages/cart/cart",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/catalog/catalog",
-                    "pathName": "pages/catalog/catalog",
-                    "query": "id=1181015",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/category/category",
-                    "pathName": "pages/category/category",
-                    "query": "id=1036009",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/orderDetail/orderDetail",
-                    "pathName": "pages/ucenter/orderDetail/orderDetail",
-                    "query": "id=142",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": 10,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/payResult/payResult",
-                    "pathName": "pages/payResult/payResult",
-                    "query": "status=1",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/cart/cart",
-                    "pathName": "pages/cart/cart",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": 12,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/addressAdd/addressAdd",
-                    "pathName": "pages/ucenter/addressAdd/addressAdd",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/logistics/index",
-                    "pathName": "pages/logistics/index",
-                    "query": "no=75326914125277&id=157",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": 14,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/order/order",
-                    "pathName": "pages/ucenter/order/order",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/feedback/feedback",
-                    "pathName": "pages/ucenter/feedback/feedback",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/feedback/feedback",
-                    "pathName": "pages/ucenter/feedback/feedback",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/shopping/checkout/checkout",
-                    "pathName": "pages/shopping/checkout/checkout",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/address/address",
-                    "pathName": "pages/ucenter/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/shopping/address/address",
-                    "pathName": "pages/shopping/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/shopping/address/address",
-                    "pathName": "pages/shopping/address/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/search/search",
-                    "pathName": "pages/search/search",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/webview/index",
-                    "pathName": "pages/webview/index",
-                    "query": "url=gu6HmTLKp",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/auth/btnAuth/btnAuth",
-                    "pathName": "pages/auth/btnAuth/btnAuth",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/brandDetail/brandDetail",
-                    "pathName": "pages/brandDetail/brandDetail",
-                    "query": "id=1046017",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": 25,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/ucenter/orderDetail/orderDetail",
-                    "pathName": "pages/ucenter/orderDetail/orderDetail",
-                    "query": "id=412",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "pages/webview/index",
-                    "pathName": "pages/webview/index",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-=======
-                    "id": -1,
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "name": "dataReport/pages/data-report/data-report",
-                    "pathName": "dataReport/pages/data-report/data-report",
-                    "query": "",
-                    "scene": null
-                },
-                {
-<<<<<<< HEAD
-                    "name": "首页",
-                    "pathName": "pages/index/index",
-                    "query": "",
-=======
-                    "id": -1,
-                    "name": "首页",
-                    "pathName": "pages/index/index",
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-                    "scene": null
-                }
-            ]
-        }
-<<<<<<< HEAD
-    },
-    "packOptions": {
-        "ignore": [],
-        "include": []
-    },
-    "editorSetting": {
-        "tabIndent": "insertSpaces",
-        "tabSize": 4
-=======
->>>>>>> parent of 47233d2 (feat: 添加新版带看功能)
-    }
+{
+    "appid": "wx0509bd21546d1597",
+    "projectname": "FDshop",
+    "compileType": "miniprogram",
+    "packOptions": {
+        "ignore": [],
+        "include": []
+    },
+    "condition": {
+        "miniprogram": {
+            "list": [
+                {
+                    "name": "选择优惠券",
+                    "pathName": "pages/shopping/selCoupon/selCoupon",
+                    "query": "isBuy=false"
+                },
+                {
+                    "name": "订单界面",
+                    "pathName": "pages/shopping/checkout/checkout",
+                    "query": "isBuy=true"
+                },
+                {
+                    "name": "我的优惠券",
+                    "pathName": "pages/ucenter/coupon/coupon",
+                    "query": "isBuy=true"
+                },
+                {
+                    "name": "我的订单",
+                    "pathName": "pages/ucenter/order/order",
+                    "query": ""
+                },
+                {
+                    "name": "pages/goods/goods",
+                    "pathName": "pages/goods/goods",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/index/index",
+                    "pathName": "pages/ucenter/index/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/cart/cart",
+                    "pathName": "pages/cart/cart",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "name": "pages/catalog/catalog",
+                    "pathName": "pages/catalog/catalog",
+                    "query": "id=1181015",
+                    "scene": null
+                },
+                {
+                    "name": "pages/category/category",
+                    "pathName": "pages/category/category",
+                    "query": "id=1036009",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/orderDetail/orderDetail",
+                    "pathName": "pages/ucenter/orderDetail/orderDetail",
+                    "query": "id=142",
+                    "scene": null
+                },
+                {
+                    "name": "pages/payResult/payResult",
+                    "pathName": "pages/payResult/payResult",
+                    "query": "status=1",
+                    "scene": null
+                },
+                {
+                    "name": "pages/cart/cart",
+                    "pathName": "pages/cart/cart",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/addressAdd/addressAdd",
+                    "pathName": "pages/ucenter/addressAdd/addressAdd",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/logistics/index",
+                    "pathName": "pages/logistics/index",
+                    "query": "no=75326914125277&id=157",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/order/order",
+                    "pathName": "pages/ucenter/order/order",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/feedback/feedback",
+                    "pathName": "pages/ucenter/feedback/feedback",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/feedback/feedback",
+                    "pathName": "pages/ucenter/feedback/feedback",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/shopping/checkout/checkout",
+                    "pathName": "pages/shopping/checkout/checkout",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/address/address",
+                    "pathName": "pages/ucenter/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/shopping/address/address",
+                    "pathName": "pages/shopping/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/shopping/address/address",
+                    "pathName": "pages/shopping/address/address",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/search/search",
+                    "pathName": "pages/search/search",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/webview/index",
+                    "pathName": "pages/webview/index",
+                    "query": "url=gu6HmTLKp",
+                    "scene": null
+                },
+                {
+                    "name": "pages/auth/btnAuth/btnAuth",
+                    "pathName": "pages/auth/btnAuth/btnAuth",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "pages/brandDetail/brandDetail",
+                    "pathName": "pages/brandDetail/brandDetail",
+                    "query": "id=1046017",
+                    "scene": null
+                },
+                {
+                    "name": "pages/ucenter/orderDetail/orderDetail",
+                    "pathName": "pages/ucenter/orderDetail/orderDetail",
+                    "query": "id=412",
+                    "scene": null
+                },
+                {
+                    "name": "pages/webview/index",
+                    "pathName": "pages/webview/index",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "dataReport/pages/data-report/data-report",
+                    "pathName": "dataReport/pages/data-report/data-report",
+                    "query": "",
+                    "scene": null
+                },
+                {
+                    "name": "首页",
+                    "pathName": "pages/index/index",
+                    "query": "",
+                    "scene": null
+                }
+            ]
+        }
+    },
+    "setting": {
+        "es6": true,
+        "enhance": true,
+        "postcss": true,
+        "minified": true,
+        "coverView": true,
+        "showShadowRootInWxmlPanel": true,
+        "babelSetting": {
+            "ignore": [],
+            "disablePlugins": [],
+            "outputPath": ""
+        },
+        "useIsolateContext": false,
+        "packNpmRelationList": [],
+        "condition": false,
+        "ignoreUploadUnusedFiles": false
+    },
+    "editorSetting": {
+        "tabIndent": "insertSpaces",
+        "tabSize": 4
+    }
 }

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+    "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+    "libVersion": "2.26.2",
+    "setting": {
+        "urlCheck": false
+    }
+}

+ 1 - 1
socket.js

@@ -227,7 +227,7 @@ export default {
     return {
       role: this.role || 'leader',
       userId: userInfo.userId,
-      avatar: userInfo.avatarUrl,
+      avatar: userInfo.avatarUrl ||'https://platform-wxmall.oss-cn-beijing.aliyuncs.com/upload/20180727/150547696d798c.png',
       nickname:  userInfo.nickname,
       voiceStatus: getApp().globalData.voiceProps.noMute ? 0 : 2,
       roomId: room,