Commit dfc501a5b4e5e6e45e02abd54412f75fc11336aa
1 parent
c4c3ea07
1.小程序客服使用小程序客服组件
2.小程序获取地址要用小程序获取微信地址
Showing
6 changed files
with
90 additions
and
13 deletions
pages/goods/goodsInfo/goodsInfo.js
pages/goods/goodsInfo/goodsInfo.wxml
@@ -733,10 +733,15 @@ | @@ -733,10 +733,15 @@ | ||
733 | 733 | ||
734 | <!-------------------底部按钮--------------------> | 734 | <!-------------------底部按钮--------------------> |
735 | <view class="join-cart"> | 735 | <view class="join-cart"> |
736 | - <view bindtap="contactService" class="custom-service cart-ico new_split"> | 736 | + <!-- bindtap="contactService" --> |
737 | + <button class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
737 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | 738 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
738 | <view>客服</view> | 739 | <view>客服</view> |
739 | - </view> | 740 | + </button> |
741 | + | ||
742 | + | ||
743 | + | ||
744 | + | ||
740 | <view bindtap="collectGoods" class="custom-service cart-ico new_split"> | 745 | <view bindtap="collectGoods" class="custom-service cart-ico new_split"> |
741 | <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image> | 746 | <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image> |
742 | <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image> | 747 | <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image> |
pages/goods/goodsInfo/goodsInfo.wxss
@@ -2560,4 +2560,9 @@ border-radius: 55rpx; | @@ -2560,4 +2560,9 @@ border-radius: 55rpx; | ||
2560 | .carde_frame{ | 2560 | .carde_frame{ |
2561 | height: 50rpx; | 2561 | height: 50rpx; |
2562 | line-height: 18rpx | 2562 | line-height: 18rpx |
2563 | +} | ||
2564 | + | ||
2565 | +button.custom-service { line-height: normal; border: 0;} | ||
2566 | +button.custom-service::after{ | ||
2567 | + border: 0; | ||
2563 | } | 2568 | } |
2564 | \ No newline at end of file | 2569 | \ No newline at end of file |
pages/user/address_list/address_list.js
@@ -154,5 +154,59 @@ Page({ | @@ -154,5 +154,59 @@ Page({ | ||
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | - } | 157 | + } , |
158 | + | ||
159 | + //获取微信地址 | ||
160 | + get_wx:function(){ | ||
161 | + var th=this; | ||
162 | + wx.getSetting({ | ||
163 | + success(res) { | ||
164 | + console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address']) | ||
165 | + if (res.authSetting['scope.address']) { | ||
166 | + wx.chooseAddress({ | ||
167 | + success(res) { | ||
168 | + th.save_wx_addr(res); | ||
169 | + } | ||
170 | + }) | ||
171 | + | ||
172 | + } else { | ||
173 | + if (res.authSetting['scope.address'] == false) { | ||
174 | + console.log("222") | ||
175 | + wx.openSetting({ | ||
176 | + success(res) {} | ||
177 | + }) | ||
178 | + } else { | ||
179 | + | ||
180 | + wx.chooseAddress({ | ||
181 | + success(res) { | ||
182 | + th.save_wx_addr(res); | ||
183 | + } | ||
184 | + }) | ||
185 | + } | ||
186 | + } | ||
187 | + } | ||
188 | + }) | ||
189 | + }, | ||
190 | + | ||
191 | + save_wx_addr:function (res) { | ||
192 | + var pd={},th=this; | ||
193 | + pd.store_id=os.stoid; | ||
194 | + pd.user_id=getApp().globalData.user_id; | ||
195 | + pd.userName=res.userName; | ||
196 | + pd.provinceName=res.provinceName; | ||
197 | + pd.countryName=res.countyName; | ||
198 | + pd.cityName=res.cityName; | ||
199 | + pd.detailInfo=res.detailInfo; | ||
200 | + pd.postalCode=res.postalCode; | ||
201 | + pd.telNumber=res.telNumber; | ||
202 | + getApp().request.promisePost("/api/weshop/useraddress/saveWx",{data:pd}).then(res=>{ | ||
203 | + if(res.data.code==0){ | ||
204 | + getApp().my_warnning("保存成功",1,th); | ||
205 | + setTimeout(function () { | ||
206 | + th.onShow(); | ||
207 | + },1000) | ||
208 | + } | ||
209 | + }) | ||
210 | + | ||
211 | + } | ||
158 | }); | 212 | }); |
159 | \ No newline at end of file | 213 | \ No newline at end of file |
pages/user/address_list/address_list.wxml
@@ -69,12 +69,17 @@ | @@ -69,12 +69,17 @@ | ||
69 | 69 | ||
70 | </view> | 70 | </view> |
71 | 71 | ||
72 | - <!-- 新建收货地址 --> | ||
73 | - <view class="new"> | ||
74 | - <navigator bindtap="go_url" data-url="/pages/user/add_address/add_address"> | ||
75 | - <view class="add">+</view> | ||
76 | - <view class="addAddress">新建收货地址</view> | ||
77 | - </navigator> | ||
78 | - </view> | 72 | + <!-- 新建收货地址 --> |
73 | + <view class="new flex jc_sb"> | ||
74 | + <navigator bindtap="get_wx" class="ye"> | ||
75 | + <view class="add">+</view> | ||
76 | + <view class="addAddress">获取微信地址</view> | ||
77 | + </navigator> | ||
78 | + | ||
79 | + <navigator bindtap="go_url" data-url="/pages/user/add_address/add_address"> | ||
80 | + <view class="add">+</view> | ||
81 | + <view class="addAddress">新建收货地址</view> | ||
82 | + </navigator> | ||
83 | + </view> | ||
79 | 84 | ||
80 | </view> | 85 | </view> |
81 | \ No newline at end of file | 86 | \ No newline at end of file |
pages/user/address_list/address_list.wxss
@@ -213,14 +213,14 @@ page { | @@ -213,14 +213,14 @@ page { | ||
213 | } | 213 | } |
214 | 214 | ||
215 | .container .new { | 215 | .container .new { |
216 | - width: 100%; | 216 | + width: 86%; |
217 | display: flex; | 217 | display: flex; |
218 | - justify-content: center; | ||
219 | position: fixed; | 218 | position: fixed; |
220 | bottom: 0rpx; | 219 | bottom: 0rpx; |
221 | height: 204rpx; | 220 | height: 204rpx; |
222 | align-items: center; | 221 | align-items: center; |
223 | background-color: rgb(255, 255, 255); | 222 | background-color: rgb(255, 255, 255); |
223 | + margin-left:7% | ||
224 | } | 224 | } |
225 | 225 | ||
226 | .container .new .add { | 226 | .container .new .add { |
@@ -229,7 +229,7 @@ page { | @@ -229,7 +229,7 @@ page { | ||
229 | 229 | ||
230 | .container navigator { | 230 | .container navigator { |
231 | display: flex; | 231 | display: flex; |
232 | - width: 430rpx; | 232 | + width: 300rpx; |
233 | height: 62rpx; | 233 | height: 62rpx; |
234 | background-color: rgb(239, 22, 51); | 234 | background-color: rgb(239, 22, 51); |
235 | border-radius: 40rpx; | 235 | border-radius: 40rpx; |
@@ -238,3 +238,10 @@ page { | @@ -238,3 +238,10 @@ page { | ||
238 | color: rgb(255, 255, 255); | 238 | color: rgb(255, 255, 255); |
239 | font-size: 27rpx; | 239 | font-size: 27rpx; |
240 | } | 240 | } |
241 | + | ||
242 | +.container navigator.ye{ | ||
243 | + background-color: #fc872d; | ||
244 | +} | ||
245 | +.nothing .address navigator.ye{ | ||
246 | + background-color: #fc872d; | ||
247 | +} |