sun2511 il y a 2 ans
Parent
commit
2cbf3300c6

+ 1 - 0
pages/index/index.js

@@ -482,6 +482,7 @@ Page({
                 updateId: item.userRead.id
               })
             } */
+            console.log(item);
             const temp = {};
             temp.title = item.userRead.title;
             temp.summary = item.userRead.summary;

+ 1 - 0
pages/my/index.js

@@ -26,6 +26,7 @@ Page({
         this.getProducts()
     },
     async onShow() {
+        wx.hideHomeButton();
         let uid = wx.getStorageSync('uid') || ''
         if (!uid) {
             getOpenidNoLogin(async() => {

+ 86 - 15
pages/mycollection/mycollection.js

@@ -212,24 +212,95 @@ Page({
             ifTapActivity: e.detail.currentTarget.dataset.activity
         })
     },
-
+    creatShare(video) {
+        return new Promise((resolve, reject) => {
+            let context = wx.createSelectorQuery();
+            context
+                .select('#share')
+                .fields({
+                    node: true,
+                    size: true
+                }).exec((res) => {
+                    const canvas = res[0].node;
+                    const ctx = canvas.getContext('2d');
+                    const dpr = wx.getSystemInfoSync().pixelRatio;
+                    canvas.width = res[0].width * dpr;
+                    canvas.height = res[0].height * dpr;
+                    ctx.scale(dpr, dpr);
+                    ctx.font = '14px PingFang';
+                    let pic = canvas.createImage();
+                    pic.src = video.coverImg; //可以是本地,也可以是网络图片
+                    pic.onload = () => {
+                        ctx.drawImage(pic, 0, 0, 375, 211);
+                    }
+                    let peiyin = canvas.createImage();
+                    peiyin.src = '/static/image/peiyin.jpg';
+                    peiyin.onload = () => {
+                        ctx.drawImage(peiyin, 0, 211, 375, 89);
+                        // 收藏,一个一个渲染
+                        let sc = canvas.createImage();
+                        sc.src = '/static/image/no_collect.png'
+                        sc.onload = () => {
+                            ctx.drawImage(sc, 12, 220, 20, 20)
+                            ctx.fillText('收藏', 36, 238)
+                                //分享
+                            let fx = canvas.createImage();
+                            fx.src = '/static/index/share.png'
+                            fx.onload = () => {
+                                ctx.drawImage(fx, 78, 220, 22, 22)
+                                ctx.fillText('分享', 104, 238)
+                                    //点赞
+                                let dz = canvas.createImage();
+                                dz.src = video.isLike ? '/static/index/heart_colored.png' : '/static/index/heart.png'
+                                dz.onload = () => {
+                                    ctx.drawImage(dz, 258, 222, 22, 22)
+                                    ctx.fillText(video.likes, 284, 238)
+                                        //评论
+                                    let pl = canvas.createImage();
+                                    pl.src = '/static/index/comment.png'
+                                    pl.onload = () => {
+                                        ctx.drawImage(pl, 318, 222, 22, 22)
+                                        ctx.fillText(video.commentAmount, 340, 238)
+                                        setTimeout(() => {
+                                            wx.canvasToTempFilePath({
+                                                canvas: canvas,
+                                                success(res) {
+                                                    resolve({
+                                                        title: '请欣赏我的课文朗读作品,点赞+评论。',
+                                                        path: `/pages/index/index?readId=${video.id}&uid=${wx.getStorageSync('uid')}`,
+                                                        imageUrl: res.tempFilePath
+                                                    })
+                                                },
+                                                fail(res) {
+                                                    reject()
+                                                }
+                                            }, this)
+                                        }, 500)
+                                    }
+                                }
+                            }
+                        }
+                    }
+                })
+        })
+    },
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage: function(res) {
-        console.log('用户点分享', res)
-        if (res.from === 'button') {
-            return {
-                title: '请欣赏我的课文朗读作品,点赞+评论。',
-                path: `/pages/index/index?readId=${this.data.shareId}&activity=${this.data.ifTapActivity}&uid=${wx.getStorageSync('uid')}`,
-                imageUrl: this.data.shareImg
-
-            }
-        } else {
-            return {
-                title: '课文朗读,从未如此有趣。',
-                path: '/pages/index/index',
-            }
+    onShareAppMessage({
+        target
+    }) {
+        let video = target.dataset.info
+        const promise = new Promise(resolve => {
+            this.creatShare(video).then(res => {
+                resolve(res)
+            })
+        })
+        return {
+            title: '请欣赏我的课文朗读作品,点赞+评论。',
+            path: `/pages/index/index?readId=${video.id}&uid=${wx.getStorageSync('uid')}`,
+            imageUrl: video.coverImg,
+            promise
         }
     },
     addShareAmount: function(e) {

+ 1 - 0
pages/mycollection/mycollection.wxml

@@ -18,3 +18,4 @@
   </view>
 </view>
  <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+ <canvas id='share' type="2d"> </canvas>

+ 87 - 17
pages/myworks/myworks.js

@@ -260,26 +260,96 @@ Page({
             ifTapActivity: e.detail.currentTarget.dataset.activity
         })
     },
+    creatShare(video) {
+        return new Promise((resolve, reject) => {
+            let context = wx.createSelectorQuery();
+            context
+                .select('#share')
+                .fields({
+                    node: true,
+                    size: true
+                }).exec((res) => {
+                    const canvas = res[0].node;
+                    const ctx = canvas.getContext('2d');
+                    const dpr = wx.getSystemInfoSync().pixelRatio;
+                    canvas.width = res[0].width * dpr;
+                    canvas.height = res[0].height * dpr;
+                    ctx.scale(dpr, dpr);
+                    ctx.font = '14px PingFang';
+                    let pic = canvas.createImage();
+                    pic.src = video.coverImg; //可以是本地,也可以是网络图片
+                    pic.onload = () => {
+                        ctx.drawImage(pic, 0, 0, 375, 211);
+                    }
+                    let peiyin = canvas.createImage();
+                    peiyin.src = '/static/image/peiyin.jpg';
+                    peiyin.onload = () => {
+                        ctx.drawImage(peiyin, 0, 211, 375, 89);
+                        // 收藏,一个一个渲染
+                        let sc = canvas.createImage();
+                        sc.src = '/static/image/no_collect.png'
+                        sc.onload = () => {
+                            ctx.drawImage(sc, 12, 220, 20, 20)
+                            ctx.fillText('收藏', 36, 238)
+                                //分享
+                            let fx = canvas.createImage();
+                            fx.src = '/static/index/share.png'
+                            fx.onload = () => {
+                                ctx.drawImage(fx, 78, 220, 22, 22)
+                                ctx.fillText('分享', 104, 238)
+                                    //点赞
+                                let dz = canvas.createImage();
+                                dz.src = video.isLike ? '/static/index/heart_colored.png' : '/static/index/heart.png'
+                                dz.onload = () => {
+                                    ctx.drawImage(dz, 258, 222, 22, 22)
+                                    ctx.fillText(video.likes, 284, 238)
+                                        //评论
+                                    let pl = canvas.createImage();
+                                    pl.src = '/static/index/comment.png'
+                                    pl.onload = () => {
+                                        ctx.drawImage(pl, 318, 222, 22, 22)
+                                        ctx.fillText(video.commentAmount, 340, 238)
+                                        setTimeout(() => {
+                                            wx.canvasToTempFilePath({
+                                                canvas: canvas,
+                                                success(res) {
+                                                    resolve({
+                                                        title: '请欣赏我的课文朗读作品,点赞+评论。',
+                                                        path: `/pages/index/index?readId=${video.id}&uid=${wx.getStorageSync('uid')}`,
+                                                        imageUrl: res.tempFilePath
+                                                    })
+                                                },
+                                                fail(res) {
+                                                    reject()
+                                                }
+                                            }, this)
+                                        }, 500)
+                                    }
+                                }
+                            }
+                        }
+                    }
+                })
+        })
+    },
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage: function(res) {
-        console.log('点击分享按钮', res)
-        console.log('点击分享按钮', this.data.shareTitle)
-        console.log('点击分享按钮', this.data.shareId)
-        console.log('点击分享按钮', this.data.shareImg)
-        if (res.from === 'button') {
-            return {
-                title: '请欣赏我的课文朗读作品,点赞+评论。',
-                path: `/pages/index/index?readId=${this.data.shareId}&activity=${this.data.ifTapActivity}&uid=${wx.getStorageSync('uid')}`,
-                imageUrl: this.data.shareImg
-
-            }
-        } else {
-            return {
-                title: '课文朗读,从未如此有趣。',
-                path: '/pages/index/index',
-            }
+    onShareAppMessage({
+        target
+    }) {
+        let video = target.dataset.info
+        const promise = new Promise(resolve => {
+            this.creatShare(video).then(res => {
+                resolve(res)
+            })
+        })
+        console.log(video);
+        return {
+            title: '请欣赏我的课文朗读作品,点赞+评论。',
+            path: `/pages/index/index?readId=${video.id}&uid=${wx.getStorageSync('uid')}`,
+            imageUrl: video.coverImg,
+            promise
         }
     },
     addShareAmount: function(e) {

+ 36 - 36
pages/myworks/myworks.wxml

@@ -1,44 +1,44 @@
-<!-- pages/user/myworks/myworks.wxml -->
-<!-- <wxs src="../../commonWxs/format.wxs" module="format" /> -->
-<!-- <StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" /> -->
+<wxs src="../../utils/filter.wxs" module="filters" />
+
 <scroll-view class='user-works'>
-  <view class='follow-details'>
-    <view class='follow-info'>
-      <view class='set-msg'>
-        <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
-        <text class="avatar-nickname">{{ wareCards.user.nickName }}</text>
-      </view>
-      <view class="follow" wx:if="{{!isMyself}}" bindtap="follow">
-        <!-- <image src="{{isFans? '../../static/index/followed.png' : '../../static/index/follow.png'}}" /> -->
-        <!-- <text class="followBtn">{{isFans ? '已' : ''}}关注</text> -->
-        <image src="{{isFans? '../../static/index/followed_btn.png' : '../../static/index/follow_btn.png'}}" />
+    <view class='follow-details'>
+        <view class='follow-info'>
+            <view class='set-msg'>
+                <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
+                <text class="avatar-nickname">{{ wareCards.user.nickName }}</text>
+            </view>
+            <view class="follow" wx:if="{{!isMyself}}" bindtap="follow">
+                <!-- <image src="{{isFans? '../../static/index/followed.png' : '../../static/index/follow.png'}}" /> -->
+                <!-- <text class="followBtn">{{isFans ? '已' : ''}}关注</text> -->
+                <image src="{{isFans? '../../static/index/followed_btn.png' : '../../static/index/follow_btn.png'}}" />
 
-      </view>
-    </view>
-    <view class='mine-category'>
-      <view class='play-count'>
-          <text>作品</text>
-          {{ wareCards.readAmount || 0 }}
-      </view>
-      <view class='play-count'>
-          <text>播放量</text>
-          {{ wareCards.playAmount || 0 }}
-      </view>
-      <view class='follow-count'>
-          <text>粉丝</text>
-          {{ wareCards.fansAmount || 0 }}
-      </view>
-      <view class='flower-count'>
-        <text>小红花</text>
-        {{ wareCards.integralAmount || 0 }}
-      </view>
+            </view>
+        </view>
+        <view class='mine-category'>
+            <view class='play-count'>
+                <text>作品</text>
+                {{ wareCards.readAmount || 0 }}
+            </view>
+            <view class='play-count'>
+                <text>播放量</text>
+                {{ wareCards.playAmount || 0 }}
+            </view>
+            <view class='follow-count'>
+                <text>粉丝</text>
+                {{ wareCards.fansAmount || 0 }}
+            </view>
+            <view class='flower-count'>
+                <text>小红花</text>
+                {{ wareCards.integralAmount || 0 }}
+            </view>
+        </view>
     </view>
-  </view>
 
 
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" bindgoToReading="goToReading" bindaddShareAmount="addShareAmount" bindplay="onPlay"></VideoSwiper>
+    <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" bindgoToReading="goToReading" bindaddShareAmount="addShareAmount" bindplay="onPlay"></VideoSwiper>
 </scroll-view>
-<view class="comment_section" catchtouchmove="touchMove"  catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
+<view class="comment_section" catchtouchmove="touchMove" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" />
 </view>
- <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<canvas id='share' type="2d"> </canvas>

+ 8 - 0
pages/user/myEdit/myEdit.js

@@ -69,6 +69,14 @@ Page({
     optionSetting: function(e) {
         console.log(e.detail.value);
     },
+    onChooseAvatar(e) {
+        const {
+            avatarUrl
+        } = e.detail
+        this.setData({
+            ['user.avatar']: avatarUrl,
+        })
+    },
     changeAvatar: function(e) {
         const _this = this;
         wx.chooseImage({

+ 57 - 62
pages/user/myEdit/myEdit.wxml

@@ -1,65 +1,60 @@
 <!-- <StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" /> -->
-
-<view style="background:#f7f7f7;margin-top:-30rpx;height: 100%">
-  <view class="avatarBox" name="avatar" value="user.avatar">
-    <image src="{{user.avatar}}" bindtap="changeAvatar" class="avatarImage" />
-    <view class="avatar-text" bindtap="changeAvatar">
-      <text>修改头像</text>
-      <image src='../../../static/image/edit_new.png' class='icon'></image>
+<view style="background:#f7f7f7;overflow: hidden;height: 100%">
+    <button class="avatar-wrapper resetBtn" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
+        <image class="avatar" src="{{user.avatar}}"></image>
+    </button>
+    <view class='setting-info'>
+        <form bindsubmit="formSubmit" class='form'>
+            <view class='nickname-box'>
+                <text class='setting-title'>昵称</text>
+                <view class='user-action'>
+                    <input name='nickname' type="nickname" placeholder="请输入昵称" class='nickname' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' value='{{user.nickName}}' bindblur='saveNickName'></input>
+                </view>
+                <view class='edit-img'>
+                    <image src='../../../static/image/edit_new.png' class='icon'></image>
+                </view>
+            </view>
+            <view class='sex-box'>
+                <view class='setting-title'>性别</view>
+                <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
+                    <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
+                        <text class='sex-title'>{{ item.sex }}</text>
+                        <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
+                    </label>
+                </radio-group>
+            </view>
+            <view class='birthday-box'>
+                <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
+                    <view class="picker">
+                        <text class='setting-title'>生日</text>
+                        <text>{{ date }}</text>
+                    </view>
+                </picker>
+                <view class='edit-img'>
+                    <image src='../../../static/image/edit_new.png' class='icon'></image>
+                </view>
+            </view>
+            <view class='birthday-box'>
+                <picker name='gradePicker' value="{{gradeIndex}}" range="{{gradeArray}}" bindchange="bindGradeChange">
+                    <view class="picker">
+                        <text class='setting-title'>年级</text>
+                        <text>{{ gradeObject[gradeIndex].name}}</text>
+                    </view>
+                </picker>
+                <view class='edit-img'>
+                    <image src='../../../static/image/edit_new.png' class='icon'></image>
+                </view>
+            </view>
+            <view class='school-box'>
+                <text class='setting-title'>学校</text>
+                <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
+                <view class='edit-image'>
+                    <image src='../../../static/image/edit_new.png' class='icon'></image>
+                </view>
+            </view>
+            <view class="submit-btn">
+                <button class='btn' formType="submit">保存</button>
+            </view>
+        </form>
     </view>
-  </view>
-  <view class='setting-info'>
-    <form bindsubmit="formSubmit" class='form'>
-      <view class='nickname-box'>
-        <text class='setting-title'>昵称</text>
-        <view class='user-action'>
-          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
-        </view>
-        <view class='edit-img'>
-          <image src='../../../static/image/edit_new.png' class='icon'></image>
-        </view>
-      </view>
-      <view class='sex-box'>
-        <view class='setting-title'>性别</view>
-        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
-          <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
-            <text class='sex-title'>{{ item.sex }}</text>
-            <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
-          </label>
-        </radio-group>
-      </view>
-      <view class='birthday-box'>
-        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
-          <view class="picker">
-            <text class='setting-title'>生日</text>
-            <text>{{ date }}</text>
-          </view>
-        </picker>
-        <view class='edit-img'>
-          <image src='../../../static/image/edit_new.png' class='icon'></image>
-        </view>
-      </view>
-      <view class='birthday-box'>
-        <picker name='gradePicker'  value="{{gradeIndex}}" range="{{gradeArray}}" bindchange="bindGradeChange">
-          <view class="picker">
-            <text class='setting-title'>年级</text>
-            <text>{{ gradeObject[gradeIndex].name}}</text>
-          </view>
-        </picker>
-        <view class='edit-img'>
-          <image src='../../../static/image/edit_new.png' class='icon'></image>
-        </view>
-      </view>
-      <view class='school-box'>
-        <text class='setting-title'>学校</text>
-        <input name='address' maxlength="14" class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
-        <view class='edit-image'>
-          <image src='../../../static/image/edit_new.png' class='icon'></image>
-        </view>
-      </view>
-      <view class="submit-btn">
-        <button class='btn' formType="submit">保存</button>
-      </view>
-    </form>
-  </view>
 </view>

+ 205 - 200
pages/user/myEdit/myEdit.wxss

@@ -1,235 +1,240 @@
-/* page{
-  width: 750rpx;
-  height: 1206rpx;
-  padding-top: 0;
-  background: #F7F7F7;
-} */
-
-.setting-info{
-  width: 100%;
-  height: 100%;
-  overflow: hidden;
-  padding: 0 17rpx;
-  font-size: 32rpx;
-  color: #5E5E5E;
-  background: #F7F7F7;
-  overflow-x: hidden;
-  margin-top: 20rpx;
-}
-
-.nickname-box{
-  margin-top: 34rpx;
-  width: 716rpx;
-  height: 88rpx;
-  position: relative;
-  box-sizing: border-box;
-  padding: 22rpx 0 22rpx 26rpx;
-  display: flex;
-  align-items: center;
-  background: #FFFFFF;
-  border-radius: 12rpx;
+.avatar-wrapper {
+    overflow: hidden;
+    padding: 0;
+    border-radius: 8px;
+    margin: 50rpx 0rpx;
+    border: none;
 }
 
-.nickname-box, .grade{
-  margin-top: 20rpx;
+.avatar {
+    margin: 0 auto;
+    display: block;
+    width: 140rpx;
+    height: 140rpx;
+    border-radius: 50%;
 }
 
-.user-action{
-  /* min-width: 100rpx; */
-  /* max-width: 400rpx; */
-  width: 74%;
+.container {
+    display: flex;
 }
 
-.nickname{
-  width: 74%;
+.setting-info {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    padding: 0 17rpx;
+    font-size: 32rpx;
+    color: #5E5E5E;
+    background: #F7F7F7;
+    overflow-x: hidden;
 }
 
-.setting-title{
-  display: inline-block;
-  width: 145rpx;
-  text-align: center;
+.nickname-box {
+    margin-top: 34rpx;
+    width: 716rpx;
+    height: 88rpx;
+    position: relative;
+    box-sizing: border-box;
+    padding: 22rpx 0 22rpx 26rpx;
+    display: flex;
+    align-items: center;
+    background: #FFFFFF;
+    border-radius: 12rpx;
 }
 
-.placeholderStyle{
-  font-size: 32rpx;
-  color: #737373;
+.nickname-box,
+.grade {
+    margin-top: 20rpx;
 }
 
-.edit-img{
-  position: absolute;
-  right:50rpx;
-  top: 24rpx;
-  width: 22rpx;
-  height: 32rpx;
+.user-action {
+    /* min-width: 100rpx; */
+    /* max-width: 400rpx; */
+    width: 74%;
 }
 
-.icon{
-  width: 100%;
-  height: 100%;
+.nickname {
+    width: 74%;
 }
 
-.sex-box{
-  margin-top: 20rpx;
-  width: 716rpx;
-  height: 88rpx;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  background: #FFFFFF;
-  padding: 22rpx 0 22rpx 26rpx;
-  border-radius: 12rpx;
+.setting-title {
+    display: inline-block;
+    width: 145rpx;
+    text-align: center;
 }
 
-.school-title,.radio-each,.birthday-title,.occupation-title{
-  margin-right: 30rpx;
+.placeholderStyle {
+    font-size: 32rpx;
+    color: #737373;
 }
 
-.radio-group{
-  display: flex;
-  height: 42rpx;
-  overflow: hidden;
-  /* margin-top: -8rpx; */
+.edit-img {
+    position: absolute;
+    right: 50rpx;
+    top: 24rpx;
+    width: 22rpx;
+    height: 32rpx;
 }
 
-/* .sex-title{
-  position: relative;
-  top: 10rpx;
-} */
-
-.radio{
-  margin-right: 50rpx;
-  display: flex;
-  
-}
-
-radio .wx-radio-input.wx-radio-input-checked::before{
-   border-radius: 50%;
-   width: 8rpx; 
-   height: 8rpx; 
-   text-align: center;
-   font-size:0rpx; /* 对勾大小 去掉 */
-   background-color: #FF5E00; 
-   transform:translate(-50%, -50%) scale(1);
-   -webkit-transform:translate(-50%, -50%) scale(1);
-}
-
-radio{
-  margin-left: 20rpx;
-  border-radius: 50%;
-  width: 28rpx;/* 最好是4的倍数,不然会不在中间 */
-  height: 28rpx;
-  border: 4rpx solid #FF8100;/* 设置边框(外圆) */
-  font-size: 0;/* 让边框重合 */
-  margin-top: 6rpx;
-}
-radio .wx-radio-input{
-   border-radius: 50%;
-   width: 28rpx;
-   height: 28rpx; 
-   border: none;/* 替换边框(隐藏原有边框) */
-}
-
-radio .wx-radio-input.wx-radio-input-checked{
-   border: none;
-   background: #f00; 
-}
-
-
-.birthday-box{
-  margin-top: 20rpx;
-  width: 716rpx;
-  height: 88rpx;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  background: #FFFFFF;
-  padding: 22rpx 0 22rpx 26rpx;
-  border-radius: 12rpx;
-  position: relative;
-  overflow:hidden;
-
-}
-
-.occupation-box{
-  margin-top: 20rpx;
-  width: 716rpx;
-  height: 88rpx;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  background: #FFFFFF;
-  padding: 22rpx 0 22rpx 26rpx;
-  border-radius: 12rpx;
-}
-
-.school-box{
-  margin-top: 20rpx;
-  width: 716rpx;
-  height: 88rpx;
-  box-sizing: border-box;
-  display: flex;
-  align-items: center;
-  background: #FFFFFF;
-  padding: 22rpx 0 22rpx 26rpx;
-  border-radius: 12rpx;
-  position: relative;
+.icon {
+    width: 100%;
+    height: 100%;
 }
 
-.address{
-  /* width: 420rpx; */
-  /* height: 88rpx; */
-  width: 74%;
+.sex-box {
+    margin-top: 20rpx;
+    width: 716rpx;
+    height: 88rpx;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    background: #FFFFFF;
+    padding: 22rpx 0 22rpx 26rpx;
+    border-radius: 12rpx;
 }
 
-.edit-image{
-  position: absolute;
-  right: 50rpx;
-  top: 24rpx;
-  width: 22rpx;
-  height: 32rpx;
+.school-title,
+.radio-each,
+.birthday-title,
+.occupation-title {
+    margin-right: 30rpx;
 }
 
-.submit-btn{
-  margin-top: 92rpx;
-  width: 716rpx;
-  height: 200rpx;
-  display: flex;
-  justify-content: center;
-  align-items: center;
+.radio-group {
+    display: flex;
+    height: 42rpx;
+    overflow: hidden;
+    /* margin-top: -8rpx; */
 }
 
-.btn{
-  font-size: 40rpx;
-  color: #FFFFFF;
-  width: 464rpx;
-  line-height: 80rpx;
-  border-radius: 80rpx;
-  background: #FF9209;
-}
 
-picker {
-  width: 100%;
-}
+/* .sex-title{
+  position: relative;
+  top: 10rpx;
+} */
 
-.avatarBox{
-  width: 100%;
-  height: 200rpx;
-  margin: 0 auto;
-  padding-top: 30rpx;
-}
-.avatarImage{
-  width: 120rpx;
-  height: 120rpx;
-  border-radius: 50%;
-  margin: 0 auto;
-  display: block;
-  margin-top: 30rpx;
+.radio {
+    margin-right: 50rpx;
+    display: flex;
+}
+
+radio .wx-radio-input.wx-radio-input-checked::before {
+    border-radius: 50%;
+    width: 8rpx;
+    height: 8rpx;
+    text-align: center;
+    font-size: 0rpx;
+    /* 对勾大小 去掉 */
+    background-color: #FF5E00;
+    transform: translate(-50%, -50%) scale(1);
+    -webkit-transform: translate(-50%, -50%) scale(1);
+}
+
+radio {
+    margin-left: 20rpx;
+    border-radius: 50%;
+    width: 28rpx;
+    /* 最好是4的倍数,不然会不在中间 */
+    height: 28rpx;
+    border: 4rpx solid #FF8100;
+    /* 设置边框(外圆) */
+    font-size: 0;
+    /* 让边框重合 */
+    margin-top: 6rpx;
+}
+
+radio .wx-radio-input {
+    border-radius: 50%;
+    width: 28rpx;
+    height: 28rpx;
+    border: none;
+    /* 替换边框(隐藏原有边框) */
+}
+
+radio .wx-radio-input.wx-radio-input-checked {
+    border: none;
+    background: #f00;
+}
+
+.birthday-box {
+    margin-top: 20rpx;
+    width: 716rpx;
+    height: 88rpx;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    background: #FFFFFF;
+    padding: 22rpx 0 22rpx 26rpx;
+    border-radius: 12rpx;
+    position: relative;
+    overflow: hidden;
+}
+
+.occupation-box {
+    margin-top: 20rpx;
+    width: 716rpx;
+    height: 88rpx;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    background: #FFFFFF;
+    padding: 22rpx 0 22rpx 26rpx;
+    border-radius: 12rpx;
+}
+
+.school-box {
+    margin-top: 20rpx;
+    width: 716rpx;
+    height: 88rpx;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    background: #FFFFFF;
+    padding: 22rpx 0 22rpx 26rpx;
+    border-radius: 12rpx;
+    position: relative;
+}
+
+.address {
+    /* width: 420rpx; */
+    /* height: 88rpx; */
+    width: 74%;
+}
+
+.edit-image {
+    position: absolute;
+    right: 50rpx;
+    top: 24rpx;
+    width: 22rpx;
+    height: 32rpx;
+}
+
+.submit-btn {
+    margin-top: 92rpx;
+    width: 716rpx;
+    height: 200rpx;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.btn {
+    font-size: 40rpx;
+    color: #FFFFFF;
+    width: 464rpx;
+    line-height: 80rpx;
+    border-radius: 80rpx;
+    background: #FF9209;
 }
-.avatar-text{
-  width: 100%;
-  font-size: 34rpx;
-  color: rgb(0, 162, 255);
-  text-align: center;
-  margin-top: 24rpx;
+
+picker {
+    width: 100%;
 }
 
+.avatar-text {
+    width: 100%;
+    font-size: 34rpx;
+    color: rgb(0, 162, 255);
+    text-align: center;
+    margin-top: 24rpx;
+}

+ 1 - 1
utils/APIClient.js

@@ -481,7 +481,7 @@ module.exports = {
         }).url(url).method('POST').send();
     },
     // 用户行为统计
-    userEvent(code, readId = false) {
+    userEvent(code, readId) {
         let url = getBaseUrl('wx/userEvent/v2');
         return request.getInstance().header({
             uid: wx.getStorageSync('uid')