jufubao-base 1.0.243-beta1001 → 1.0.243-beta1003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.243-beta1001",
3
+ "version": "1.0.243-beta1003",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -329,7 +329,9 @@
329
329
  vm: this,
330
330
  data: {},
331
331
  }).then(res => {
332
- this.userInfo = res || {};
332
+ res = res || {};
333
+ if(res['head_url']) res['head_url'] = getServiceUrl(res['head_url'], 'size2')
334
+ this.userInfo = res;
333
335
  })
334
336
  },
335
337
  async p_getAsyncStep() {
@@ -1106,4 +1108,4 @@
1106
1108
  line-height: inherit;
1107
1109
  }
1108
1110
  }
1109
- </style>
1111
+ </style>
@@ -50,7 +50,6 @@
50
50
  v-if="hasAuthLogin"
51
51
  :disabled="!panelIsChecked"
52
52
  type="primary"
53
- open-type="getUserInfo"
54
53
  :radius="btnRadius + 'rpx'"
55
54
  @click="doWxMpLogin"
56
55
  >
@@ -784,18 +783,12 @@ export default {
784
783
  uni.login({
785
784
  provider: "weixin",
786
785
  success: (loginRes) => {
787
- let raw_data = {
788
- encryptedData:detail.encryptedData,
789
- iv:detail.iv,
790
- signature: detail.signature
791
- }
792
786
  jfbRootExec("loginThirdLogin", {
793
787
  vm: this,
794
788
  data: {
795
789
  third_auth_code: loginRes.code,
796
790
  provider_id: this.quickLogin.provider_id,
797
791
  share_code: this.share_code,
798
- raw_data
799
792
  },
800
793
  })
801
794
  .then((res) => {
@@ -15,7 +15,7 @@ module.exports = [
15
15
  disabled: true,
16
16
  },
17
17
  {
18
- mapFnName: "getVipList",
18
+ mapFnName: "getOpenVipList",
19
19
  title: "会员中心 - 会员卡列表",
20
20
  path: "/member/v1/vip-card",
21
21
  isRule: false,
@@ -74,7 +74,7 @@
74
74
  </view>
75
75
  </view> -->
76
76
  </view>
77
-
77
+
78
78
  <xd-vip-list v-if="!isVip" :list="showVipCardList"
79
79
  @handlePrivacy="handlePrivacy"
80
80
  @toVipDetail="toVipDetail"
@@ -188,6 +188,8 @@
188
188
  vm: this,
189
189
  data: {}
190
190
  }).then(res => {
191
+ res = res || {};
192
+ if(res['head_url']) res['head_url'] = getServiceUrl(res['head_url'], 'size2')
191
193
  this.uInfo = res;
192
194
  this.vip_expire_time = this.$xdUniHelper.getDate(res.vip_expire_time * 1000 ).fullDate;
193
195
  })
@@ -201,7 +203,7 @@
201
203
  })
202
204
  },
203
205
  p_getVipList(){
204
- jfbRootExec("getVipList", {
206
+ jfbRootExec("getOpenVipList", {
205
207
  vm: this,
206
208
  data: {}
207
209
  }).then(res => {
@@ -2,6 +2,6 @@
2
2
 
3
3
  module.exports = {
4
4
  getOpenBaseUserInfo: {"user_name":"","user_code":"Uf4zx6EPfV","nickname":"未来~","real_name":"","head_url":"https:\/\/thirdwx.qlogo.cn\/mmopen\/vi_32\/Q0j4TwGTfTJsajZzh53IB56crRSdmKvRbjT4V1Ha8v5uCOkASbWS0GibgLeic8OKBzAwUyBa3vZGhjwmd6RfpG9g\/132","province_code":"","city_code":"","province_name":"","city_name":"","sex":"","sex_name":"未知","birthday_date":"","phone_number":"13611111111","show_user_name":"未来~","user_level":"","vip_expire_time":1745026677,"request_id":"250e5709e6c95066"},
5
- getVipList: {"total_size":3,"next_page_token":"","list":[{"vip_card_id":3,"product_id":60038520,"product_name":"体验卡","sale_price":200,"vip_card_icon":""},{"vip_card_id":2,"product_id":60038519,"product_name":"月卡","sale_price":2678,"vip_card_icon":""},{"vip_card_id":1,"product_id":60038515,"product_name":"测1","sale_price":20085,"vip_card_icon":""}],"request_id":"6b4aef5e06411d8a"},
5
+ getOpenVipList: {"total_size":3,"next_page_token":"","list":[{"vip_card_id":3,"product_id":60038520,"product_name":"体验卡","sale_price":200,"vip_card_icon":""},{"vip_card_id":2,"product_id":60038519,"product_name":"月卡","sale_price":2678,"vip_card_icon":""},{"vip_card_id":1,"product_id":60038515,"product_name":"测1","sale_price":20085,"vip_card_icon":""}],"request_id":"6b4aef5e06411d8a"},
6
6
  getVipMoneySaving: { "save_amount": 100 , "request_id": "6b4aef5e06411d8a" }
7
7
  }
@@ -6,7 +6,7 @@
6
6
  @click="handleChoseVip(item.vip_card_id)"
7
7
  >
8
8
  <view class="vip_name">{{ item.product_name}}</view>
9
- <view class="vip_price">{{ $xdUniHelper.divisionFloatNumber(item.sale_price, 100) }}</view>
9
+ <view class="vip_price">¥{{ $xdUniHelper.divisionFloatNumber(item.sale_price, 100).toFixed(2) }}</view>
10
10
  </view>
11
11
  </view>
12
12
  <view class="vip_pay">
@@ -14,7 +14,6 @@
14
14
  <template v-if="vip_card_id===-1">0元开通</template>
15
15
  <template v-else>
16
16
  立即支付 ¥{{ $xdUniHelper.divisionFloatNumber(curVipCard.sale_price, 100) }}
17
- {{ curVipCard.vip_card_life_cycle_unit ? '/'+curVipCard.vip_card_life_cycle_unit:'' }}
18
17
  </template>
19
18
  </view>
20
19
  <view class="vip_tip">开通视为同意<text @click.stop="handlePrivacy('privacy_service')">《共享PLUS会员用户协议》</text></view>
@@ -8,7 +8,13 @@
8
8
  <view class="jfb-base-personal-data__body" v-if="info">
9
9
  <view class="jfb-base-personal-data__body-item">
10
10
  <view class="jfb-base-personal-data__body-item-label">头像</view>
11
- <image class="profile" :src="info.head_url"  ></image>
11
+ <view class="profile">
12
+ <image :src="info.head_url"></image>
13
+ <!--#ifdef MP-->
14
+ <button type="default" open-type="chooseAvatar" @chooseavatar="handleChooseAvatar"></button>
15
+ <!-- #endif -->
16
+ </view>
17
+
12
18
  </view>
13
19
  <view class="jfb-base-personal-data__body-item">
14
20
  <view class="jfb-base-personal-data__body-item-label">账号</view>
@@ -16,19 +22,45 @@
16
22
  </view>
17
23
  <view class="jfb-base-personal-data__body-item">
18
24
  <view class="jfb-base-personal-data__body-item-label">名称</view>
19
- <input @blur="handleSetInfo" @confirm="handleSetInfo" class="jfb-base-personal-data__body-item-value"
20
- v-model="info.nickname" type="text">
25
+ <!--#ifdef MP-->
26
+ <input
27
+ @change="handleWxSetInfo"
28
+ class="jfb-base-personal-data__body-item-value"
29
+ v-model="info.nickname"
30
+ type="nickname"
31
+ >
32
+ <!-- #endif -->
33
+ <!--#ifdef H5-->
34
+ <input
35
+ @blur="handleSetInfo"
36
+ @confirm="handleSetInfo"
37
+ class="jfb-base-personal-data__body-item-value"
38
+ v-model="info.nickname"
39
+ type="text"
40
+ >
41
+ <!-- #endif -->
21
42
  </view>
22
43
  <view class="jfb-base-personal-data__body-item">
23
44
  <view class="jfb-base-personal-data__body-item-label">性别</view>
24
- <XdSelect @change="handleSetSex" padding="0" color="#999" class="select" :defaultValue="info.sex"
25
- v-model="info.sex" :list="sexList">
45
+ <XdSelect
46
+ @change="handleSetSex"
47
+ padding="0"
48
+ color="#999"
49
+ class="select"
50
+ :defaultValue="info.sex"
51
+ v-model="info.sex"
52
+ :list="sexList"
53
+ >
26
54
  <template>
27
55
  <view class="jfb-base-personal-data__body-item-value">
28
- <XdFontIcon class="icon" color="#999999" size="24" icon="iconxiangyou_xian"></XdFontIcon>
56
+ <XdFontIcon
57
+ class="icon"
58
+ color="#999999"
59
+ size="24"
60
+ icon="iconxiangyou_xian"
61
+ ></XdFontIcon>
29
62
  </view>
30
63
  </template>
31
-
32
64
  </XdSelect>
33
65
  </view>
34
66
  <view class="jfb-base-personal-data__body-item">
@@ -54,6 +86,8 @@
54
86
  import { getContainerPropsValue } from "@/utils/xd.base";
55
87
  import componentsMixins from "@/mixins/componentsMixins";
56
88
  import extsMixins from "@/mixins/extsMixins";
89
+ import {mapActions} from "vuex";
90
+ import getServiceUrl from "@/common/getServiceUrl";
57
91
  export default {
58
92
  name: "JfbBasePersonalData",
59
93
  components: {
@@ -91,6 +125,45 @@
91
125
  this.init(this.container);
92
126
  },
93
127
  methods: {
128
+ //#ifdef MP
129
+ ...mapActions(['getUploadParams']),
130
+
131
+ handleChooseAvatar({detail}){
132
+ this.info.head_url = detail.avatarUrl;
133
+ let temp = detail.avatarUrl.split('.')
134
+ let ext = temp[temp.length -1];
135
+ let name = `${this.info.nickname}.${ext}`;
136
+ this.$xdShowLoading({});
137
+ this.getUploadParams({name,type: 'public'})
138
+ .then(res=>{
139
+ uni.uploadFile({
140
+ url: res.action,
141
+ filePath: detail.avatarUrl,
142
+ name: 'file',
143
+ formData: this.$xdUniHelper.cloneDeep(res),
144
+ success: (uploadFileRes) => {
145
+ this.handleSetInfo({head_url: res.url}, ()=>{
146
+ this.$xdHideLoading()
147
+ })
148
+
149
+ },
150
+ error:()=>{
151
+ this.$xdHideLoading()
152
+ }
153
+ });
154
+ })
155
+ .catch(err=>{
156
+ this.$xdHideLoading()
157
+ });
158
+ },
159
+
160
+ handleWxSetInfo(){
161
+ if(this.info.nickname) {
162
+ this.handleSetInfo();
163
+ }
164
+ },
165
+ //#endif
166
+
94
167
  onJfbLoad(options) {
95
168
  this.getInfo()
96
169
  },
@@ -100,59 +173,46 @@
100
173
  */
101
174
  init(container) {
102
175
  },
176
+
103
177
  getInfo() {
104
178
  jfbRootExec("getBasePersonInfo", {
105
179
  vm: this,
106
180
  data: {},
107
181
  }).then(res => {
108
182
  this.info = res
183
+ if(this.info.head_url) this.info.head_url = getServiceUrl(this.info.head_url,'size2')
109
184
  })
110
185
  },
111
186
  confirmDate(e) {
112
- console.log(e, 'confirmDate');
113
187
  this.info.birthday_date = e.fulldate
114
188
  this.handleSetInfo()
115
189
  },
116
- closeDate() {
117
-
118
- },
190
+ closeDate() {},
119
191
  handleSetSex(data) {
120
192
  this.info.sex = data.item.value
121
193
  this.handleSetInfo()
122
194
  },
123
- handleSetInfo() {
195
+
196
+ handleSetInfo(ext={}, cb) {
197
+ let params = {
198
+ nickname: this.info.nickname,
199
+ sex: this.info.sex,
200
+ birthday_date: this.info.birthday_date
201
+ }
202
+ //设置扩展信息
203
+ if(!this.$xdUniHelper.isEmpty(ext)) {
204
+ params = Object.assign({},params,ext);
205
+ }
206
+ debugger
124
207
  jfbRootExec("setBasePersonInfo", {
125
208
  vm: this,
126
- data: {
127
- nickname: this.info.nickname,
128
- sex: this.info.sex,
129
- birthday_date: this.info.birthday_date
130
- },
209
+ data: params,
131
210
  }).then(res => {
132
- this.getInfo()
211
+ this.getInfo();
212
+ if(typeof cb === 'function') cb();
133
213
  })
134
214
  },
135
- onJfbScroll(options) {
136
- console.log('event.onJfbScroll', options)
137
- },
138
- onJfbReachBottom(options) {
139
- console.log('event.onJfbReachBottom', options)
140
- },
141
- onJfbShow(options) {
142
- console.log('event.onJfbShow', options)
143
- },
144
- onJfbHide(options) {
145
- console.log('event.onJfbHide', options)
146
- },
147
- onJfbBack(options) {
148
- console.log('event.onJfbBack', options)
149
- },
150
- onJfbUpdate(...data) {
151
- console.log('event.onJfbUpdate', data)
152
- },
153
- onJfbCustomEvent(options) {
154
- console.log('event.onJfbReachBottom', options)
155
- },
215
+
156
216
  }
157
217
  }
158
218
 
@@ -193,6 +253,24 @@
193
253
  width: 80rpx;
194
254
  height: 80rpx;
195
255
  border-radius: 50%;
256
+ position: relative;
257
+ overflow: hidden;
258
+
259
+ & > image {
260
+ width: 78rpx;
261
+ height: 78rpx;
262
+ border-radius: 50%;
263
+ border:1px solid #ccc;
264
+ box-sizing: border-box;
265
+ }
266
+ & > button {
267
+ position: absolute;
268
+ left: 0;
269
+ right: 0;
270
+ bottom: 0;
271
+ top: 0;
272
+ opacity: 0;
273
+ }
196
274
  }
197
275
  }
198
276
  }
@@ -460,7 +460,7 @@ export default {
460
460
  },
461
461
  },
462
462
  computed: {
463
- ...mapState(["brandInfo", "siteInfo"]),
463
+ ...mapState(["brandInfo", "siteInfo", "jfbAuthorize"]),
464
464
  ...styleForm.getComputedItem(),
465
465
  },
466
466
  created() {
@@ -598,6 +598,11 @@ export default {
598
598
  },
599
599
 
600
600
  handleOrderResolve(info) {
601
+ //#ifdef MP-WEIXIN
602
+ if(info.is_clear_vip_cookie && info.is_clear_vip_cookie === 'Y'){
603
+ this.jfbAuthorize.removeToken('access');
604
+ }
605
+ //#endif
601
606
  info.btn = [
602
607
  { label: "返回首页", value: 1, type: "default", radius: "12rpx" },
603
608
  {
@@ -341,9 +341,10 @@
341
341
  vm: this,
342
342
  data: {}
343
343
  }).then(res => {
344
- this.userInfo = res || {};
344
+ res = res || {};
345
+ if(res['head_url']) res['head_url'] = getServiceUrl(res['head_url'], 'size2')
346
+ this.userInfo = res;
345
347
  this.logined = true;
346
- console.log('getBaseUserInfo', res)
347
348
  }).catch(error => {
348
349
  console.log('getBaseUserInfo', error)
349
350
  });
@@ -352,13 +353,13 @@
352
353
 
353
354
  this.logined = await this.jfbAuthorize.checkUserLogin(true, this, false);
354
355
  if (!this.logined) return;
355
-
356
356
  jfbRootExec('getBaseUserInfo', {
357
357
  vm: this,
358
358
  data: {}
359
359
  }).then(res => {
360
- this.userInfo = res || {};
361
- console.log('getBaseUserInfo', res)
360
+ res = res || {};
361
+ if(res['head_url']) res['head_url'] = getServiceUrl(res['head_url'], 'size2')
362
+ this.userInfo = res;
362
363
  }).catch(error => {
363
364
  console.log('getBaseUserInfo', error)
364
365
  })