作者 赵云辉

ios支付未修改完成

@@ -17,19 +17,16 @@ @@ -17,19 +17,16 @@
17 }, 17 },
18 methods: { 18 methods: {
19 onReadyStateUpdate({name}) { 19 onReadyStateUpdate({name}) {
20 -  
21 const isSDKReady = name === this.$TIM.EVENT.SDK_READY ? true : false; 20 const isSDKReady = name === this.$TIM.EVENT.SDK_READY ? true : false;
22 //自动监听并更新 sdk 的ready 状态 (未登录是 notReady 登录后是ready) 21 //自动监听并更新 sdk 的ready 状态 (未登录是 notReady 登录后是ready)
23 this.$store.commit("toggleIsSDKReady", isSDKReady); 22 this.$store.commit("toggleIsSDKReady", isSDKReady);
24 //sdk ready 后 肯定完成了登录操作 这里可以获取用户存储在im的基础信息/离线消息/黑名单列表 23 //sdk ready 后 肯定完成了登录操作 这里可以获取用户存储在im的基础信息/离线消息/黑名单列表
25 }, 24 },
26 -  
27 onReceiveMessage({data: messageList}) { 25 onReceiveMessage({data: messageList}) {
28 // this.handleAt(messageList); 26 // this.handleAt(messageList);
29 this.$store.commit("pushCurrentMessageList", messageList); 27 this.$store.commit("pushCurrentMessageList", messageList);
30 }, 28 },
31 //根据消息列表请求聊天对象的用户信息 并完成数据拼接 29 //根据消息列表请求聊天对象的用户信息 并完成数据拼接
32 -  
33 }, 30 },
34 onLaunch: function() { 31 onLaunch: function() {
35 // #ifdef APP-PLUS 32 // #ifdef APP-PLUS
1 <template> 1 <template>
2 <view class="htz-image-upload-list"> 2 <view class="htz-image-upload-list">
3 - <view class="htz-image-upload-Item" v-if="uploadType == 'image'" v-for="(item,index) in uploadLists" :key="index"> 3 + <u-line-progress v-if="ifvideo" :striped="true" :striped-active="true" active-color="#19BE6B" height="16" :percent="percent"></u-line-progress>
  4 + <view class="htz-image-upload-Item" v-if="uploadType == 'image'" v-for="(item,index) in uploadLists"
  5 + :key="index">
4 <image :src="imgUrl + item" @click="imgPreview(index)"></image> 6 <image :src="imgUrl + item" @click="imgPreview(index)"></image>
5 <view class="htz-image-upload-Item-del" v-if="remove" @click="imgDel(index)">×</view> 7 <view class="htz-image-upload-Item-del" v-if="remove" @click="imgDel(index)">×</view>
6 </view> 8 </view>
7 - <view class="htz-image-upload-video" v-if="uploadType == 'video'" v-for="(item,index) in uploadLists" :key="index">  
8 - <video :id="'video_'+index" :src="imgUrl + item" :data-index="index" :controls="true" :enable-play-gesture="true" objectFit="contain"></video> 9 + <view class="htz-image-upload-video" v-if="uploadType == 'video'" v-for="(item,index) in uploadLists"
  10 + :key="index">
  11 + <video :id="'video_'+index" :src="imgUrl + item" :data-index="index" :controls="true"
  12 + :enable-play-gesture="true" objectFit="contain"></video>
9 <view class="delBtn"> 13 <view class="delBtn">
10 <view class="btn" @click="videoDel(index)"> 14 <view class="btn" @click="videoDel(index)">
11 删除 15 删除
@@ -61,9 +65,9 @@ @@ -61,9 +65,9 @@
61 imagesEdit: { //受控图片列表 65 imagesEdit: { //受控图片列表
62 type: Array 66 type: Array
63 }, 67 },
64 - videoEdit:{  
65 - type:String,  
66 - default:'' 68 + videoEdit: {
  69 + type: String,
  70 + default: ''
67 }, 71 },
68 uploadSuccess: { 72 uploadSuccess: {
69 default: (res) => { 73 default: (res) => {
@@ -73,28 +77,31 @@ @@ -73,28 +77,31 @@
73 } 77 }
74 }, 78 },
75 }, 79 },
76 - pgType:{  
77 - type:String,  
78 - default:'' 80 + pgType: {
  81 + type: String,
  82 + default: ''
79 } 83 }
80 }, 84 },
81 data() { 85 data() {
82 return { 86 return {
83 - uploadType:'', 87 + ifvideo:false,
  88 + percent:0,
  89 + uploadType: '',
84 uploadLists: [], 90 uploadLists: [],
85 - imgUrl:this.imgUrl,  
86 - max:1 91 + imgUrl: this.imgUrl,
  92 + max: 1
87 } 93 }
88 }, 94 },
89 mounted() { 95 mounted() {
90 - console.log(this.imagesEdit,this.videoEdit)  
91 - if(this.imagesEdit.length > 0){ 96 + console.log(this.imagesEdit, this.videoEdit)
  97 + if (this.imagesEdit.length > 0) {
92 this.uploadType = 'image' 98 this.uploadType = 'image'
93 this.max = 9 99 this.max = 9
94 this.uploadLists = this.imagesEdit; 100 this.uploadLists = this.imagesEdit;
95 } 101 }
96 - if(this.videoEdit != ''){ 102 + if (this.videoEdit != '') {
97 this.uploadType = 'video' 103 this.uploadType = 'video'
  104 +
98 this.uploadLists.push(this.videoEdit); 105 this.uploadLists.push(this.videoEdit);
99 } 106 }
100 }, 107 },
@@ -117,40 +124,47 @@ @@ -117,40 +124,47 @@
117 content: '您确定要删除么?', 124 content: '您确定要删除么?',
118 success: (res) => { 125 success: (res) => {
119 if (res.confirm) { 126 if (res.confirm) {
120 - let delUrl=this.uploadLists[index] 127 + let delUrl = this.uploadLists[index]
121 this.uploadLists.splice(index, 1) 128 this.uploadLists.splice(index, 1)
122 this.$emit("changeImage", this.uploadLists); 129 this.$emit("changeImage", this.uploadLists);
123 } else if (res.cancel) {} 130 } else if (res.cancel) {}
124 } 131 }
125 }); 132 });
126 }, 133 },
127 - videoDel(index){ 134 + videoDel(index) {
128 uni.showModal({ 135 uni.showModal({
129 title: '提示', 136 title: '提示',
130 content: '您确定要删除么?', 137 content: '您确定要删除么?',
131 success: (res) => { 138 success: (res) => {
132 if (res.confirm) { 139 if (res.confirm) {
  140 +
133 this.uploadLists.splice(index, 1) 141 this.uploadLists.splice(index, 1)
134 this.$emit("changeVideo", this.uploadLists); 142 this.$emit("changeVideo", this.uploadLists);
  143 + this.percent = 0
  144 + this.ifvideo = false
135 } else if (res.cancel) {} 145 } else if (res.cancel) {}
136 } 146 }
137 }); 147 });
138 }, 148 },
139 imgPreview(index) { 149 imgPreview(index) {
140 let imgPreview = [] 150 let imgPreview = []
141 - this.uploadLists.forEach((item)=>{ 151 + this.uploadLists.forEach((item) => {
142 imgPreview.push(this.imgUrl + item) 152 imgPreview.push(this.imgUrl + item)
143 }) 153 })
144 uni.previewImage({ 154 uni.previewImage({
145 urls: imgPreview, 155 urls: imgPreview,
146 - current:index,  
147 - loop:true 156 + current: index,
  157 + loop: true
148 }); 158 });
149 }, 159 },
150 imgAdd() { 160 imgAdd() {
  161 + // 视频上传中不允许触发第二次
  162 + if(this.ifvideo) {
  163 + return
  164 + }
151 let nowNum 165 let nowNum
152 let thisNum 166 let thisNum
153 - if(this.pgType == '' && (this.uploadType == '' || this.uploadLists.length == 0)){ 167 + if (this.pgType == '' && (this.uploadType == '' || this.uploadLists.length == 0)) {
154 uni.showActionSheet({ 168 uni.showActionSheet({
155 itemList: ['选择图片', '选择视频'], 169 itemList: ['选择图片', '选择视频'],
156 success: (res) => { 170 success: (res) => {
@@ -159,33 +173,36 @@ @@ -159,33 +173,36 @@
159 this.max = 9 173 this.max = 9
160 nowNum = Math.abs(this.uploadLists.length - this.max); 174 nowNum = Math.abs(this.uploadLists.length - this.max);
161 thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量 175 thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
162 - this.$emit('changeType',1) 176 + this.$emit('changeType', 1)
163 this.chooseImage(thisNum) 177 this.chooseImage(thisNum)
  178 + this.ifvideo = false
164 } else if (res.tapIndex == 1) { 179 } else if (res.tapIndex == 1) {
165 this.uploadType = 'video' 180 this.uploadType = 'video'
166 this.max = 1 181 this.max = 1
167 - this.$emit('changeType',2)  
168 - this.chooseVideo(thisNum) 182 + this.$emit('changeType', 2)
  183 + // this.chooseVideo(thisNum)
  184 + this.ifvideo = true
169 } 185 }
170 }, 186 },
171 fail: (res) => { 187 fail: (res) => {
172 console.log(res.errMsg); 188 console.log(res.errMsg);
  189 + this.ifvideo = false
173 } 190 }
174 }); 191 });
175 - }else if(this.pgType == 'uploadImg' || this.uploadType == 'image'){ 192 + } else if (this.pgType == 'uploadImg' || this.uploadType == 'image') {
176 this.max = 9 193 this.max = 9
177 nowNum = Math.abs(this.uploadLists.length - this.max); 194 nowNum = Math.abs(this.uploadLists.length - this.max);
178 thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量 195 thisNum = (this.chooseNum > nowNum ? nowNum : this.chooseNum) //可选数量
179 this.uploadType = 'image' 196 this.uploadType = 'image'
180 this.chooseImage(thisNum) 197 this.chooseImage(thisNum)
181 - }else{ 198 + } else {
182 this.chooseVideo(thisNum) 199 this.chooseVideo(thisNum)
183 } 200 }
184 }, 201 },
185 - chooseVideo(thisNum){ 202 + chooseVideo(thisNum) {
186 uni.chooseVideo({ 203 uni.chooseVideo({
187 count: thisNum, 204 count: thisNum,
188 - compressed:false, 205 + compressed: false,
189 sourceType: ['camera', 'album'], 206 sourceType: ['camera', 'album'],
190 success: (res) => { 207 success: (res) => {
191 /* if(res.size/(1024*1024) > 100){ 208 /* if(res.size/(1024*1024) > 100){
@@ -195,83 +212,93 @@ @@ -195,83 +212,93 @@
195 }) 212 })
196 return 213 return
197 }else{ */ 214 }else{ */
198 - uni.showLoading({  
199 - title:'上传中...'  
200 - })  
201 - let filePath = res.tempFilePath  
202 -  
203 - console.log(filePath)  
204 - console.log(filePath.lastIndexOf('.'))  
205 - console.log(filePath.length)  
206 - console.log(filePath.substr(filePath.lastIndexOf('.'),filePath.length))  
207 - // #ifdef APP-PLUS  
208 - let suffix = filePath.substr(filePath.lastIndexOf('.'),filePath.length)  
209 - // #endif  
210 - // #ifndef APP-PLUS  
211 - let suffix = res.name.substr(res.name.lastIndexOf('.'),res.name.length)  
212 - // #endif  
213 - //获取七牛云token  
214 - uni.request({  
215 - url:this.apiUrl + '/common/getQiniuToken',  
216 - method:'POST',  
217 - success: (qiniuRet) => {  
218 - uni.uploadFile({  
219 - url: 'https://up-z2.qiniup.com',  
220 - filePath: filePath,  
221 - name: 'file',  
222 - formData: {  
223 - 'key' : qiniuRet.data.data.key+suffix,  
224 - 'token' : qiniuRet.data.data.token  
225 - },  
226 - success: (uploadFileRes) => {  
227 - console.log('上传七牛云结果',JSON.parse(uploadFileRes.data))  
228 - uni.hideLoading()  
229 - this.uploadLists.push('/'+JSON.parse(uploadFileRes.data).key)  
230 - this.$emit("changeVideo", this.uploadLists);  
231 - },  
232 - fail: (err) => {  
233 - uni.hideLoading()  
234 - uni.showToast({  
235 - title:"上传七云牛错误",  
236 - icon:'none'  
237 - })  
238 - console.log('上传七牛云报错',err)  
239 - }  
240 - })  
241 - }  
242 - })  
243 -  
244 - /* let filePath = res.tempFilePath  
245 - uni.uploadFile({  
246 - url: this.apiUrl + '/common/upload', //仅为示例,非真实的接口地址  
247 - filePath: filePath,  
248 - timeout: 300000,  
249 - header: {  
250 - 'token': uni.getStorageSync('token')  
251 - },  
252 - name: 'file',  
253 - formData: {  
254 - 'user': 'test'  
255 - },  
256 - success: (uploadFileRes) => {  
257 - uni.hideLoading()  
258 - console.log('上传文件',JSON.parse(uploadFileRes.data));  
259 - if(JSON.parse(uploadFileRes.data).code == 1){  
260 - this.uploadLists.push(JSON.parse(uploadFileRes.data).data.url) 215 + // uni.showLoading({
  216 + // title:'上传中...'
  217 + // })
  218 +
  219 + let filePath = res.tempFilePath
  220 + console.log(filePath)
  221 + console.log(filePath.lastIndexOf('.'))
  222 + console.log(filePath.length)
  223 + console.log(filePath.substr(filePath.lastIndexOf('.'), filePath.length))
  224 + // #ifdef APP-PLUS
  225 + let suffix = filePath.substr(filePath.lastIndexOf('.'), filePath.length)
  226 + // #endif
  227 + // #ifndef APP-PLUS
  228 + let suffix = res.name.substr(res.name.lastIndexOf('.'), res.name.length)
  229 + // #endif
  230 + //获取七牛云token
  231 + uni.request({
  232 + url: this.apiUrl + '/common/getQiniuToken',
  233 + method: 'POST',
  234 + success: (qiniuRet) => {
  235 + const uploadTask = uni.uploadFile({
  236 + url: 'https://up-z2.qiniup.com',
  237 + filePath: filePath,
  238 + name: 'file',
  239 + formData: {
  240 + 'key': qiniuRet.data.data.key + suffix,
  241 + 'token': qiniuRet.data.data.token
  242 + },
  243 + success: (uploadFileRes) => {
  244 + console.log('上传七牛云结果', JSON.parse(uploadFileRes
  245 + .data))
  246 + uni.hideLoading()
  247 + this.uploadLists.push('/' + JSON.parse(
  248 + uploadFileRes.data).key)
261 this.$emit("changeVideo", this.uploadLists); 249 this.$emit("changeVideo", this.uploadLists);
262 - }else{ 250 + },
  251 + fail: (err) => {
  252 + uni.hideLoading()
263 uni.showToast({ 253 uni.showToast({
264 - title:JSON.parse(uploadFileRes.data).msg,  
265 - icon:'none' 254 + title: "上传七云牛错误",
  255 + icon: 'none'
266 }) 256 })
  257 + console.log('上传七牛云报错', err)
267 } 258 }
  259 + });
  260 + uploadTask.onProgressUpdate((res)=> {
  261 + this.percent = res.progress;
  262 + // console.log('上传进度' + res.progress);
  263 + // console.log('已经上传的数据长度' + res.totalBytesSent);
  264 + // console.log('预期需要上传的数据总长度' + res.totalBytesExpectedToSend);
  265 + });
  266 +
  267 + },
  268 +
  269 + })
  270 +
  271 + /* let filePath = res.tempFilePath
  272 + uni.uploadFile({
  273 + url: this.apiUrl + '/common/upload', //仅为示例,非真实的接口地址
  274 + filePath: filePath,
  275 + timeout: 300000,
  276 + header: {
  277 + 'token': uni.getStorageSync('token')
  278 + },
  279 + name: 'file',
  280 + formData: {
  281 + 'user': 'test'
  282 + },
  283 + success: (uploadFileRes) => {
  284 + uni.hideLoading()
  285 + console.log('上传文件',JSON.parse(uploadFileRes.data));
  286 + if(JSON.parse(uploadFileRes.data).code == 1){
  287 + this.uploadLists.push(JSON.parse(uploadFileRes.data).data.url)
  288 + this.$emit("changeVideo", this.uploadLists);
  289 + }else{
  290 + uni.showToast({
  291 + title:JSON.parse(uploadFileRes.data).msg,
  292 + icon:'none'
  293 + })
268 } 294 }
269 - }); */ 295 + }
  296 + }); */
270 // } 297 // }
271 }, 298 },
272 }) 299 })
273 }, 300 },
274 - chooseImage(thisNum){ 301 + chooseImage(thisNum) {
275 // #ifdef APP-PLUS 302 // #ifdef APP-PLUS
276 if (this.sourceType.length > 1) { 303 if (this.sourceType.length > 1) {
277 uni.showActionSheet({ 304 uni.showActionSheet({
@@ -291,7 +318,7 @@ @@ -291,7 +318,7 @@
291 if (this.sourceType.length == 1 && this.sourceType.indexOf('album') > -1) { 318 if (this.sourceType.length == 1 && this.sourceType.indexOf('album') > -1) {
292 this.appGallery(thisNum); 319 this.appGallery(thisNum);
293 } 320 }
294 - 321 +
295 if (this.sourceType.length == 1 && this.sourceType.indexOf('camera') > -1) { 322 if (this.sourceType.length == 1 && this.sourceType.indexOf('camera') > -1) {
296 this.appCamera(); 323 this.appCamera();
297 } 324 }
@@ -322,11 +349,11 @@ @@ -322,11 +349,11 @@
322 var res = cmr.supportedImageResolutions[0]; 349 var res = cmr.supportedImageResolutions[0];
323 var fmt = cmr.supportedImageFormats[0]; 350 var fmt = cmr.supportedImageFormats[0];
324 //console.log("Resolution: " + res + ", Format: " + fmt); 351 //console.log("Resolution: " + res + ", Format: " + fmt);
325 - cmr.captureImage((path)=> { 352 + cmr.captureImage((path) => {
326 //alert("Capture image success: " + path); 353 //alert("Capture image success: " + path);
327 this.chooseSuccessMethod([path]) 354 this.chooseSuccessMethod([path])
328 }, 355 },
329 - (error) =>{ 356 + (error) => {
330 //alert("Capture image failed: " + error.message); 357 //alert("Capture image failed: " + error.message);
331 console.log("Capture image failed: " + error.message) 358 console.log("Capture image failed: " + error.message)
332 }, { 359 }, {
@@ -417,14 +444,15 @@ @@ -417,14 +444,15 @@
417 'token': uni.getStorageSync('token') 444 'token': uni.getStorageSync('token')
418 }, 445 },
419 success: (uploadFileRes) => { 446 success: (uploadFileRes) => {
420 - console.log('上传图片',uploadFileRes)  
421 - if(JSON.parse(uploadFileRes.data).code == 1){  
422 - this.uploadLists.push(JSON.parse(uploadFileRes.data).data.url) 447 + console.log('上传图片', uploadFileRes)
  448 + if (JSON.parse(uploadFileRes.data).code == 1) {
  449 + this.uploadLists.push(JSON.parse(uploadFileRes.data)
  450 + .data.url)
423 this.$emit("changeImage", this.uploadLists); 451 this.$emit("changeImage", this.uploadLists);
424 - }else{ 452 + } else {
425 uni.showToast({ 453 uni.showToast({
426 - title:JSON.parse(uploadFileRes.data).msg,  
427 - icon:'none' 454 + title: JSON.parse(uploadFileRes.data).msg,
  455 + icon: 'none'
428 }) 456 })
429 } 457 }
430 resolve(uploadFileRes); 458 resolve(uploadFileRes);
@@ -506,21 +534,23 @@ @@ -506,21 +534,23 @@
506 height: 100%; 534 height: 100%;
507 border-radius: 10rpx; 535 border-radius: 10rpx;
508 } 536 }
509 -  
510 - .htz-image-upload-video{ 537 +
  538 + .htz-image-upload-video {
511 width: 750rpx; 539 width: 750rpx;
512 height: 450rpx; 540 height: 450rpx;
513 } 541 }
514 - 542 +
515 .htz-image-upload-video video { 543 .htz-image-upload-video video {
516 width: 100%; 544 width: 100%;
517 height: 400rpx; 545 height: 400rpx;
518 } 546 }
519 - .delBtn{ 547 +
  548 + .delBtn {
520 display: flex; 549 display: flex;
521 justify-content: center; 550 justify-content: center;
522 } 551 }
523 - .delBtn .btn{ 552 +
  553 + .delBtn .btn {
524 font-size: 28rpx; 554 font-size: 28rpx;
525 text-align: center; 555 text-align: center;
526 background: #f5222d; 556 background: #f5222d;
@@ -81,6 +81,7 @@ @@ -81,6 +81,7 @@
81 'token': uni.getStorageSync('token') 81 'token': uni.getStorageSync('token')
82 }, 82 },
83 success: (res) => { 83 success: (res) => {
  84 + console.log(res.data.data)
84 this.wallet = res.data.data 85 this.wallet = res.data.data
85 } 86 }
86 }) 87 })
@@ -13,8 +13,8 @@ Vue.config.productionTip = false @@ -13,8 +13,8 @@ Vue.config.productionTip = false
13 13
14 Vue.prototype.check=check; 14 Vue.prototype.check=check;
15 Vue.prototype.apiUrl="http://app.zhaodizhu.cn/api" 15 Vue.prototype.apiUrl="http://app.zhaodizhu.cn/api"
16 -// Vue.prototype.apiUrl="http://landlord.t.brotop.cn/api"  
17 -Vue.prototype.imgUrl="http://qiniu.zhaodizhu.cn" 16 +// Vue.prototype.apiUrl="http://landlord.t.brotop.cn/api" // 测试环境
  17 +Vue.prototype.imgUrl="http://qiniu.zhaodizhu.cn"
18 Vue.prototype.tim = tim.tim //tim sdk 引入后生成的tim服务 18 Vue.prototype.tim = tim.tim //tim sdk 引入后生成的tim服务
19 Vue.prototype.$TIM = TIM //tim 的状态/事件 常量 19 Vue.prototype.$TIM = TIM //tim 的状态/事件 常量
20 Vue.prototype.$commen = commen 20 Vue.prototype.$commen = commen
1 { 1 {
2 "name" : "问野", 2 "name" : "问野",
3 - "appid" : "__UNI__AE869D6", 3 + "appid" : "__UNI__6108A26",
4 "description" : "问野", 4 "description" : "问野",
5 "versionName" : "1.6", 5 "versionName" : "1.6",
6 "versionCode" : 109, 6 "versionCode" : 109,
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 "compilerVersion" : 3, 15 "compilerVersion" : 3,
16 "splashscreen" : { 16 "splashscreen" : {
17 "alwaysShowBeforeRender" : false, 17 "alwaysShowBeforeRender" : false,
18 - "waiting" : false, 18 + "waiting" : true,
19 "autoclose" : false, 19 "autoclose" : false,
20 "delay" : 0 20 "delay" : 0
21 }, 21 },
@@ -104,7 +104,8 @@ @@ -104,7 +104,8 @@
104 }, 104 },
105 "alipay" : { 105 "alipay" : {
106 "__platform__" : [ "ios", "android" ] 106 "__platform__" : [ "ios", "android" ]
107 - } 107 + },
  108 + "appleiap" : {}
108 }, 109 },
109 "geolocation" : { 110 "geolocation" : {
110 "amap" : { 111 "amap" : {
@@ -136,7 +137,7 @@ @@ -136,7 +137,7 @@
136 "xxxhdpi" : "unpackage/res/icons/192x192.png" 137 "xxxhdpi" : "unpackage/res/icons/192x192.png"
137 }, 138 },
138 "ios" : { 139 "ios" : {
139 - "appstore" : "D:/MyWork/1.20210220找地主app-梅姐、培杰/wenye_ios_icon.png", 140 + "appstore" : "C:/Users/26612/Desktop/1.20210220找地主app-梅姐、培杰/wenye_ios_icon.png",
140 "ipad" : { 141 "ipad" : {
141 "app" : "unpackage/res/icons/76x76.png", 142 "app" : "unpackage/res/icons/76x76.png",
142 "app@2x" : "unpackage/res/icons/152x152.png", 143 "app@2x" : "unpackage/res/icons/152x152.png",
@@ -163,9 +164,9 @@ @@ -163,9 +164,9 @@
163 "splashscreen" : { 164 "splashscreen" : {
164 "androidStyle" : "default", 165 "androidStyle" : "default",
165 "android" : { 166 "android" : {
166 - "hdpi" : "D:/MyWork/1.20210220找地主app-梅姐、培杰/启动页480_762.png",  
167 - "xhdpi" : "D:/MyWork/1.20210220找地主app-梅姐、培杰/启动页720_1242.png",  
168 - "xxhdpi" : "D:/MyWork/1.20210220找地主app-梅姐、培杰/启动页1080_1882.png" 167 + "hdpi" : "C:/Users/26612/Desktop/1.20210220找地主app-梅姐、培杰/启动页480_762.png",
  168 + "xhdpi" : "C:/Users/26612/Desktop/1.20210220找地主app-梅姐、培杰/启动页720_1242.png",
  169 + "xxhdpi" : "C:/Users/26612/Desktop/1.20210220找地主app-梅姐、培杰/启动页1080_1882.png"
169 }, 170 },
170 "iosStyle" : "common" 171 "iosStyle" : "common"
171 } 172 }
@@ -180,7 +180,7 @@ @@ -180,7 +180,7 @@
180 keyword:'', 180 keyword:'',
181 type:'',//类型:1=最新(报名中)2=往期(报名结束)3=推荐 181 type:'',//类型:1=最新(报名中)2=往期(报名结束)3=推荐
182 page:1, 182 page:1,
183 - per_page:50, 183 + per_page:20,
184 sort:'0',//排序:0=最新,1=最热 默认为0 184 sort:'0',//排序:0=最新,1=最热 默认为0
185 article_cate_id:'', 185 article_cate_id:'',
186 province:'', 186 province:'',
@@ -200,23 +200,32 @@ @@ -200,23 +200,32 @@
200 ...mapState(["userinfo","articleList"]) 200 ...mapState(["userinfo","articleList"])
201 }, 201 },
202 onLoad(){ 202 onLoad(){
  203 + console.log('onLoad',1)
203 uni.setStorageSync('refreshFindWonderful',false) 204 uni.setStorageSync('refreshFindWonderful',false)
204 this.param.page = 1 205 this.param.page = 1
205 this.last_page = 0 206 this.last_page = 0
206 this.current_page = 1 207 this.current_page = 1
207 this.list = [] 208 this.list = []
208 - this.showWaterFalls = false 209 + this.showWaterFalls = true
209 this.getData() 210 this.getData()
  211 + console.log('onLoad',2)
  212 + console.log('this.showWaterFalls',this.showWaterFalls)
210 }, 213 },
211 onShow(){ 214 onShow(){
  215 + console.log('onShow',1)
  216 + console.log('onShow',uni.getStorageSync('refreshFindWonderful'))
212 if(uni.getStorageSync('refreshFindWonderful')){ 217 if(uni.getStorageSync('refreshFindWonderful')){
  218 + console.log('onShow',2)
213 uni.setStorageSync('refreshFindWonderful',false) 219 uni.setStorageSync('refreshFindWonderful',false)
214 this.param.page = 1 220 this.param.page = 1
215 this.last_page = 0 221 this.last_page = 0
216 this.current_page = 1 222 this.current_page = 1
217 this.list = [] 223 this.list = []
218 this.showWaterFalls = false 224 this.showWaterFalls = false
  225 + console.log('onShow',3)
219 this.getData() 226 this.getData()
  227 + console.log('onShow',4)
  228 + console.log('this.showWaterFalls',this.showWaterFalls)
220 } 229 }
221 }, 230 },
222 onPullDownRefresh(){ 231 onPullDownRefresh(){
@@ -244,6 +253,7 @@ @@ -244,6 +253,7 @@
244 }, 253 },
245 methods: { 254 methods: {
246 getData(){ 255 getData(){
  256 + console.log('getData',this.tabIndex)
247 if(this.tabIndex == 0){ 257 if(this.tabIndex == 0){
248 this.listType == 'findPlay' 258 this.listType == 'findPlay'
249 //获取用户信息 259 //获取用户信息
@@ -258,6 +268,7 @@ @@ -258,6 +268,7 @@
258 this.list = this.list.concat(res.data.data) 268 this.list = this.list.concat(res.data.data)
259 this.$store.commit('setArticleList',this.list) 269 this.$store.commit('setArticleList',this.list)
260 this.showWaterFalls = true 270 this.showWaterFalls = true
  271 + console.log(111111111111111111111111111111)
261 }) 272 })
262 }else{ 273 }else{
263 this.$request('/article/followUserList',this.param).then((res)=>{ 274 this.$request('/article/followUserList',this.param).then((res)=>{
@@ -266,6 +277,7 @@ @@ -266,6 +277,7 @@
266 this.list = this.list.concat(res.data.data) 277 this.list = this.list.concat(res.data.data)
267 this.$store.commit('setArticleList',this.list) 278 this.$store.commit('setArticleList',this.list)
268 this.showWaterFalls = true 279 this.showWaterFalls = true
  280 + console.log(111111111111111111111111111111)
269 }) 281 })
270 } 282 }
271 }) 283 })
@@ -328,9 +340,11 @@ @@ -328,9 +340,11 @@
328 this.last_page = res.data.data.last_page 340 this.last_page = res.data.data.last_page
329 this.current_page = res.data.data.current_page 341 this.current_page = res.data.data.current_page
330 this.list = this.list.concat(res.data.data.data) 342 this.list = this.list.concat(res.data.data.data)
  343 + // console.log(this.list)
331 this.$store.commit('setArticleList',this.list) 344 this.$store.commit('setArticleList',this.list)
332 this.showWaterFalls = true 345 this.showWaterFalls = true
333 uni.hideLoading() 346 uni.hideLoading()
  347 + console.log('this.showWaterFalls',this.showWaterFalls)
334 } 348 }
335 }) 349 })
336 }, 350 },
@@ -416,7 +430,7 @@ @@ -416,7 +430,7 @@
416 this.getArticleLis() 430 this.getArticleLis()
417 } 431 }
418 432
419 - 433 + this.getData()
420 434
421 }, 435 },
422 search(){ 436 search(){
@@ -431,7 +445,7 @@ @@ -431,7 +445,7 @@
431 this.param.page = 1 445 this.param.page = 1
432 this.last_page = 0 446 this.last_page = 0
433 this.current_page = 1 447 this.current_page = 1
434 - this.list = [] 448 + this.list = []
435 this.showWaterFalls = false 449 this.showWaterFalls = false
436 // 类型:1=最新(报名中)2=往期(报名结束)3=推荐 450 // 类型:1=最新(报名中)2=往期(报名结束)3=推荐
437 this.otherTabIndex = otherTabIndex 451 this.otherTabIndex = otherTabIndex
@@ -449,7 +463,7 @@ @@ -449,7 +463,7 @@
449 this.list = [] 463 this.list = []
450 this.param.page = 1 464 this.param.page = 1
451 this.param.keyword = '' 465 this.param.keyword = ''
452 - this.param.city = '', 466 + this.param.city = '',
453 this.param.county = '', 467 this.param.county = '',
454 this.tabIndex = tabIndex 468 this.tabIndex = tabIndex
455 if(tabIndex == 1 || tabIndex == 0){ 469 if(tabIndex == 1 || tabIndex == 0){
@@ -53,7 +53,8 @@ @@ -53,7 +53,8 @@
53 <view class="gzBtn" @click="follow"> 53 <view class="gzBtn" @click="follow">
54 {{articleInfo.is_follow_user == 1 ? '已关注' : '关注'}} 54 {{articleInfo.is_follow_user == 1 ? '已关注' : '关注'}}
55 </view> 55 </view>
56 - <view class="lwBtn" @click="showSendGift = true" v-if="plat == 'android' || (plat == 'ios' && switchTab == '1')"> 56 + <!-- <view class="lwBtn" @click="showSendGift = true" v-if="plat == 'android' || (plat == 'ios' && switchTab == '1')"> -->
  57 + <view class="lwBtn" @click="showSendGift = true" v-if="plat == 'android' || plat == 'ios'">
57 送礼物 58 送礼物
58 </view> 59 </view>
59 </view> 60 </view>
1 <template> 1 <template>
2 - <list :pagingEnabled="true" :scroll-top="scrollTop" :scrollable="scrollable"class="zhi_index04" :offset-accuracy="videoStyle.height" :show-scrollbar="false" ref="list" :loadmoreoffset="loadMoreHeight" @scroll="Scroll">  
3 - <cell style="position:relative;" :style="videoStyle" v-for="(l,i) in lie" :key='i' @disappear="Disappear($event,i)" @appear="onappear"> 2 + <div class="page" :style="{ height: height }">
  3 + <list :pagingEnabled="true" :scroll-top="scrollTop" :scrollable="scrollable" class="zhi_index04"
  4 + :offset-accuracy="videoStyle.height" :show-scrollbar="false" ref="list" :loadmoreoffset="loadMoreHeight"
  5 + @scroll="Scroll">
  6 +
  7 + <cell style="position:relative;" :style="videoStyle" v-for="(l,i) in lie" :key='i'
  8 + @disappear="Disappear($event,i)" @appear="onappear">
4 <template v-if="nowId==l.id"> 9 <template v-if="nowId==l.id">
5 - <video @click="closeAllAlert(l.id)" :style="videoStyle" @play='play' @pause="pause" @timeupdate="Timeupdate" :id="`video_${l.id}`" :ref="`video_${l.id}`" :loop="true" :src="'http://qiniu.w.zhaodizhu.cn'+l.video" controls="false" :enable-progress-gesture="false" :show-center-play-btn="false" /> 10 + <video @click="closeAllAlert(l.id)" :style="videoStyle" @play='play' @pause="pause"
  11 + @timeupdate="Timeupdate" :id="`video_${l.id}`" :ref="`video_${l.id}`" :loop="true"
  12 + :src="'http://qiniu.w.zhaodizhu.cn'+l.video" controls="false" :enable-progress-gesture="false"
  13 + :show-center-play-btn="false" />
6 <!-- 导航栏区域 --> 14 <!-- 导航栏区域 -->
7 <div class="navBarWrap" :style="{top:statusBarHeight}"> 15 <div class="navBarWrap" :style="{top:statusBarHeight}">
8 - <image @click="back" src="../../static/image/back_white.png" style="width: 40rpx;height: 40rpx;" mode=""></image>  
9 - <image @click="showMoreHandle = !showMoreHandle" src="../../static/image/gengduo.png" style="width: 40rpx;height: 40rpx;" mode=""></image> 16 + <image @click="back" src="../../static/image/back_white.png" style="width: 40rpx;height: 40rpx;"
  17 + mode=""></image>
  18 + <image @click="showMoreHandle = !showMoreHandle" src="../../static/image/gengduo.png"
  19 + style="width: 40rpx;height: 40rpx;" mode=""></image>
10 </div> 20 </div>
11 - <div class="moreHandleWrap" v-if="showMoreHandle" :style="{height:l.user.id != userinfo.id ? '72rpx' : '144rpx'}"> 21 + <div class="moreHandleWrap" v-if="showMoreHandle"
  22 + :style="{height:l.user.id != userinfo.id ? '72rpx' : '144rpx'}">
12 <!-- <div class="handleItem" @click="showShare = true"> 23 <!-- <div class="handleItem" @click="showShare = true">
13 <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/fenxiang-22_1@2x.png" mode=""></image> 24 <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/fenxiang-22_1@2x.png" mode=""></image>
14 <text style="color: #35655f;font-size: 28rpx;">转发</text> 25 <text style="color: #35655f;font-size: 28rpx;">转发</text>
15 </div> --> 26 </div> -->
16 <div class="handleItem" @click="report"> 27 <div class="handleItem" @click="report">
17 - <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/jubao-9_1@2x.png" mode=""></image>  
18 - <text style="color: #35655f;font-size: 28rpx;">{{l.user.id != userinfo.id ? '举报' : '编辑'}}</text> 28 + <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"
  29 + src="../../static/image/jubao-9_1@2x.png" mode=""></image>
  30 + <text
  31 + style="color: #35655f;font-size: 28rpx;">{{l.user.id != userinfo.id ? '举报' : '编辑'}}</text>
19 </div> 32 </div>
20 <div class="handleItem" @click="delAct" v-if="l.user.id == userinfo.id"> 33 <div class="handleItem" @click="delAct" v-if="l.user.id == userinfo.id">
21 - <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/shanchu-9_1.png" mode=""></image> 34 + <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"
  35 + src="../../static/image/shanchu-9_1.png" mode=""></image>
22 <text style="color: #35655f;font-size: 28rpx;">删除</text> 36 <text style="color: #35655f;font-size: 28rpx;">删除</text>
23 </div> 37 </div>
24 </div> 38 </div>
25 - <div v-if="playIconStatus" style="position: fixed;top: 0;bottom: 0;left: 0;right: 0;flex-direction: row;justify-content: center;align-items: center;z-index:1;"> 39 + <div v-if="playIconStatus"
  40 + style="position: fixed;top: 0;bottom: 0;left: 0;right: 0;flex-direction: row;justify-content: center;align-items: center;z-index:1;">
26 <image src="../../static/image/bofang.png" style="width: 64rpx;height: 64rpx;" mode=""></image> 41 <image src="../../static/image/bofang.png" style="width: 64rpx;height: 64rpx;" mode=""></image>
27 </div> 42 </div>
28 <!-- 用户信息区域 --> 43 <!-- 用户信息区域 -->
29 <div class="userInfoWrap" :style="{bottom:expandStatus ? '400rpx' : '200rpx'}"> 44 <div class="userInfoWrap" :style="{bottom:expandStatus ? '400rpx' : '200rpx'}">
30 <div class="userInfoLeft"> 45 <div class="userInfoLeft">
31 <div class="userIcon" @click="goMainPage(l.user.id)"> 46 <div class="userIcon" @click="goMainPage(l.user.id)">
32 - <image :src="l.user.avatar" style="width: 93rpx;height: 93rpx;border-radius: 20rpx 0 20rpx 0;" mode="aspectFill"></image> 47 + <image :src="l.user.avatar"
  48 + style="width: 93rpx;height: 93rpx;border-radius: 20rpx 0 20rpx 0;"
  49 + mode="aspectFill">
  50 + </image>
33 </div> 51 </div>
34 <div class="userNameAddress"> 52 <div class="userNameAddress">
35 <div class="userName"> 53 <div class="userName">
36 <text style="font-size: 32rpx;color: #fff;">{{l.user.nickname}}</text> 54 <text style="font-size: 32rpx;color: #fff;">{{l.user.nickname}}</text>
37 </div> 55 </div>
38 <div class="userAddress" v-if="l.area != ''"> 56 <div class="userAddress" v-if="l.area != ''">
39 - <image src="../../static/image/weizhi.png" style="width: 26rpx;height: 26rpx;" mode=""></image>  
40 - <text style="color: rgba(255,255,255,0.80);font-size: 24rpx;padding-top: 8rpx;">{{l.area}}</text> 57 + <image src="../../static/image/weizhi.png" style="width: 26rpx;height: 26rpx;"
  58 + mode="">
  59 + </image>
  60 + <text
  61 + style="color: rgba(255,255,255,0.80);font-size: 24rpx;padding-top: 8rpx;">{{l.area}}</text>
41 </div> 62 </div>
42 </div> 63 </div>
43 </div> 64 </div>
@@ -45,7 +66,8 @@ @@ -45,7 +66,8 @@
45 <div class="gzBtn" @click="follow(l.user.id)"> 66 <div class="gzBtn" @click="follow(l.user.id)">
46 <text class="btnTxt">{{articleInfo.is_follow_user == 1 ? '已关注' : '关注'}}</text> 67 <text class="btnTxt">{{articleInfo.is_follow_user == 1 ? '已关注' : '关注'}}</text>
47 </div> 68 </div>
48 - <div class="lwBtn" @click="showSendGift = true" v-if="plat == 'android' || (plat == 'ios' && switchTab == '1')"> 69 + <div class="lwBtn" @click="showSendGift = true"
  70 + v-if="plat == 'android' || (plat == 'ios' && switchTab == '1')">
49 <text class="btnTxt">送礼物</text> 71 <text class="btnTxt">送礼物</text>
50 </div> 72 </div>
51 </div> 73 </div>
@@ -53,81 +75,109 @@ @@ -53,81 +75,109 @@
53 <!-- 介绍区域 --> 75 <!-- 介绍区域 -->
54 <div class="contentWrap"> 76 <div class="contentWrap">
55 <div class="content"> 77 <div class="content">
56 - <text v-if="!expandStatus" style="font-size: 28rpx;color: #fff;line-height: 100rpx;">{{l.content}}</text> 78 + <text v-if="!expandStatus"
  79 + style="font-size: 28rpx;color: #fff;line-height: 100rpx;">{{l.content}}</text>
57 </div> 80 </div>
58 <div class="expandBtn" @click="changeExpand"> 81 <div class="expandBtn" @click="changeExpand">
59 - <text style="line-height: 100rpx;color: #99a1a4;font-size: 28rpx;">{{expandStatus ? '收起' : '展开'}}</text> 82 + <text
  83 + style="line-height: 100rpx;color: #99a1a4;font-size: 28rpx;">{{expandStatus ? '收起' : '展开'}}</text>
60 </div> 84 </div>
61 </div> 85 </div>
62 <div class="otherHandleWrap"> 86 <div class="otherHandleWrap">
63 <div class="sayWhat" @click="getRemarkList"> 87 <div class="sayWhat" @click="getRemarkList">
64 - <image src="../../static/image/sayWhatIcon.png" mode="" style="width: 32rpx;height: 32rpx;margin-right: 8rpx;"></image> 88 + <image src="../../static/image/sayWhatIcon.png" mode=""
  89 + style="width: 32rpx;height: 32rpx;margin-right: 8rpx;"></image>
65 <text style="color: rgba(255,255,255,0.60);font-size: 24rpx;">说点什么</text> 90 <text style="color: rgba(255,255,255,0.60);font-size: 24rpx;">说点什么</text>
66 </div> 91 </div>
67 <div class="userHandle"> 92 <div class="userHandle">
68 - <image @click="like" class="handleImg" :src="articleInfo.is_like == 1 ? '../../static/image/yidianzan.png' : '../../static/image/dianzan.png'" mode=""></image> 93 + <image @click="like" class="handleImg"
  94 + :src="articleInfo.is_like == 1 ? '../../static/image/yidianzan.png' : '../../static/image/dianzan.png'"
  95 + mode=""></image>
69 <text class="handleNum">{{articleInfo.like_num}}</text> 96 <text class="handleNum">{{articleInfo.like_num}}</text>
70 - <image class="handleImg" @click="getRemarkList" src="../../static/image/liuyan.png" mode=""></image><text class="handleNum">{{articleInfo.remark_num}}</text>  
71 - <image @click="collect" class="handleImg" :src="articleInfo.is_collect == 1 ? '../../static/image/yishoucang.png' : '../../static/image/shoucang.png'" mode=""></image> 97 + <image class="handleImg" @click="getRemarkList" src="../../static/image/liuyan.png" mode="">
  98 + </image><text class="handleNum">{{articleInfo.remark_num}}</text>
  99 + <image @click="collect" class="handleImg"
  100 + :src="articleInfo.is_collect == 1 ? '../../static/image/yishoucang.png' : '../../static/image/shoucang.png'"
  101 + mode=""></image>
72 <text class="handleNum">{{articleInfo.collect_num}}</text> 102 <text class="handleNum">{{articleInfo.collect_num}}</text>
73 </div> 103 </div>
74 </div> 104 </div>
75 </template> 105 </template>
76 - </cell>  
77 - <progress :percent="bofangjindu" stroke-width="1" activeColor="#FFFFFF" backgroundColor="rgba(226, 226, 226, 0.3)" class="zhi_index24"/> 106 + </cell>
  107 + <progress :percent="bofangjindu" stroke-width="1" activeColor="#FFFFFF"
  108 + backgroundColor="rgba(226, 226, 226, 0.3)" class="zhi_index24" />
78 <!-- 展开内容区域 --> 109 <!-- 展开内容区域 -->
79 <!-- <scroll-view scroll-y class="expandContentWrap" v-if="expandStatus"> 110 <!-- <scroll-view scroll-y class="expandContentWrap" v-if="expandStatus">
80 <div style="white-space: pre-line;"> 111 <div style="white-space: pre-line;">
81 <textarea style="width: 100%;height: 100rpx;font-size: 28rpx;color: #fff;line-height: 100rpx;" :value="articleInfo.content" :disabled="true" /> 112 <textarea style="width: 100%;height: 100rpx;font-size: 28rpx;color: #fff;line-height: 100rpx;" :value="articleInfo.content" :disabled="true" />
82 </div> 113 </div>
83 </scroll-view> --> 114 </scroll-view> -->
84 - <div v-if="expandStatus" style="position: fixed;bottom: 200rpx;width: 750rpx;height: 200rpx;flex-direction: column;justify-content: center;align-items: center;">  
85 - <textarea style="width: 686rpx;height: 200rpx;font-size: 28rpx;color: #fff;" :value="articleInfo.content" :disabled="true" /> 115 + <div v-if="expandStatus"
  116 + style="position: fixed;bottom: 200rpx;width: 750rpx;height: 200rpx;flex-direction: column;justify-content: center;align-items: center;">
  117 + <textarea style="width: 686rpx;height: 200rpx;font-size: 28rpx;color: #fff;"
  118 + :value="articleInfo.content" :disabled="true" />
86 </div> 119 </div>
87 <!-- 评论内容弹框 --> 120 <!-- 评论内容弹框 -->
88 <div class="commentAlert" v-if="showCommentAlert"> 121 <div class="commentAlert" v-if="showCommentAlert">
89 <div class="commentNum" @click="closeAllAlert"> 122 <div class="commentNum" @click="closeAllAlert">
90 - <text style="text-align: center;font-size: 28rpx;line-height: 100rpx;">共{{remarkList.length}}条评论</text>  
91 - <image @click="showCommentAlert = false" class="closeBtn" src="../../static/image/close.png" style="width: 32rpx;height: 32rpx;" mode=""></image> 123 + <text
  124 + style="text-align: center;font-size: 28rpx;line-height: 100rpx;">共{{remarkList.length}}条评论</text>
  125 + <image @click="showCommentAlert = false" class="closeBtn" src="../../static/image/close.png"
  126 + style="width: 32rpx;height: 32rpx;" mode=""></image>
92 </div> 127 </div>
93 <scroll-view scroll-y class="commentList"> 128 <scroll-view scroll-y class="commentList">
94 <div v-for="(item,index) in remarkList" :key="index" @click="closeAllAlert"> 129 <div v-for="(item,index) in remarkList" :key="index" @click="closeAllAlert">
95 <div class="commentItem"> 130 <div class="commentItem">
96 - <image @click="goMainPage(item.user.id)" :src="item.user.avatar" style="width: 93rpx;height: 93rpx;border-radius: 20rpx 0 20rpx 0;" mode="aspectFill"></image> 131 + <image @click="goMainPage(item.user.id)" :src="item.user.avatar"
  132 + style="width: 93rpx;height: 93rpx;border-radius: 20rpx 0 20rpx 0;" mode="aspectFill">
  133 + </image>
97 <div class="commentRight"> 134 <div class="commentRight">
98 <div class="userNickName"> 135 <div class="userNickName">
99 <text style="color: #969799;font-size: 28rpx;">{{item.user.nickname}}</text> 136 <text style="color: #969799;font-size: 28rpx;">{{item.user.nickname}}</text>
100 <text style="color: #969799;font-size: 28rpx;">{{item.createtime}}</text> 137 <text style="color: #969799;font-size: 28rpx;">{{item.createtime}}</text>
101 </div> 138 </div>
102 - <text @longpress="changeAskHandle(index)" @click="remarkInp(item.id,index)" style="font-size: 28rpx;line-height: 42rpx;padding-top: 8rpx;">{{item.content}}</text>  
103 - <text @click="item.showReply = true" style="font-size: 28rpx;color: #5176d1;padding-top: 16rpx;" v-if="item.article_reply.length > 0 && !item.showReply">展开{{item.article_reply.length}}条回复</text> 139 + <text @longpress="changeAskHandle(index)" @click="remarkInp(item.id,index)"
  140 + style="font-size: 28rpx;line-height: 42rpx;padding-top: 8rpx;">{{item.content}}</text>
  141 + <text @click="item.showReply = true"
  142 + style="font-size: 28rpx;color: #5176d1;padding-top: 16rpx;"
  143 + v-if="item.article_reply.length > 0 && !item.showReply">展开{{item.article_reply.length}}条回复</text>
104 </div> 144 </div>
105 </div> 145 </div>
106 <div class="askHandleWrap" v-if="item.showAskHandle"> 146 <div class="askHandleWrap" v-if="item.showAskHandle">
107 <div class="handleItem" @click="reply(item.id,index)"> 147 <div class="handleItem" @click="reply(item.id,index)">
108 - <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/huifu.png" mode=""></image> 148 + <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"
  149 + src="../../static/image/huifu.png" mode=""></image>
109 <text style="color: #35655f;font-size: 28rpx;">回复</text> 150 <text style="color: #35655f;font-size: 28rpx;">回复</text>
110 </div> 151 </div>
111 <div class="handleItem" @click="handleAsk(item.id,index,item.user.id)"> 152 <div class="handleItem" @click="handleAsk(item.id,index,item.user.id)">
112 - <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/jubao-9_1@2x.png" mode=""></image>  
113 - <text style="color: #35655f;font-size: 28rpx;">{{item.user.id != userinfo.id ? '举报' : '删除'}}</text> 153 + <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"
  154 + src="../../static/image/jubao-9_1@2x.png" mode=""></image>
  155 + <text
  156 + style="color: #35655f;font-size: 28rpx;">{{item.user.id != userinfo.id ? '举报' : '删除'}}</text>
114 </div> 157 </div>
115 </div> 158 </div>
116 <div v-for="(subItem,subIndex) in item.article_reply" :key="subIndex"> 159 <div v-for="(subItem,subIndex) in item.article_reply" :key="subIndex">
117 - <div class="replyHandleWrap" v-if="subItem.showReplyHandle && subItem.user.id == userinfo.id"> 160 + <div class="replyHandleWrap"
  161 + v-if="subItem.showReplyHandle && subItem.user.id == userinfo.id">
118 <div class="handleItem" @click="handleReply(subItem.id,subIndex,subItem.user.id)"> 162 <div class="handleItem" @click="handleReply(subItem.id,subIndex,subItem.user.id)">
119 - <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;" src="../../static/image/jubao-9_1@2x.png" mode=""></image> 163 + <image style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"
  164 + src="../../static/image/jubao-9_1@2x.png" mode=""></image>
120 <text style="color: #35655f;font-size: 28rpx;">删除</text> 165 <text style="color: #35655f;font-size: 28rpx;">删除</text>
121 </div> 166 </div>
122 </div> 167 </div>
123 <div v-if="item.showReply" class="commentSubItem"> 168 <div v-if="item.showReply" class="commentSubItem">
124 - <image @click="goMainPage(subItem.user.id)" :src="subItem.user.avatar" style="width: 68rpx;height: 68rpx;border-radius: 20rpx 0 20rpx 0;" mode="aspectFill"></image> 169 + <image @click="goMainPage(subItem.user.id)" :src="subItem.user.avatar"
  170 + style="width: 68rpx;height: 68rpx;border-radius: 20rpx 0 20rpx 0;"
  171 + mode="aspectFill">
  172 + </image>
125 <div class="commentRight"> 173 <div class="commentRight">
126 <div class="userNickName"> 174 <div class="userNickName">
127 <text style="color: #969799;font-size: 28rpx;">{{subItem.user.nickname}}</text> 175 <text style="color: #969799;font-size: 28rpx;">{{subItem.user.nickname}}</text>
128 <text style="color: #969799;font-size: 28rpx;">{{subItem.createtime}}</text> 176 <text style="color: #969799;font-size: 28rpx;">{{subItem.createtime}}</text>
129 </div> 177 </div>
130 - <text @longpress="subItem.showReplyHandle = true" @click="subItem.showReplyHandle = false" style="font-size: 28rpx;line-height: 42rpx;padding-top: 8rpx;">{{subItem.content}}</text> 178 + <text @longpress="subItem.showReplyHandle = true"
  179 + @click="subItem.showReplyHandle = false"
  180 + style="font-size: 28rpx;line-height: 42rpx;padding-top: 8rpx;">{{subItem.content}}</text>
131 </div> 181 </div>
132 </div> 182 </div>
133 </div> 183 </div>
@@ -135,8 +185,10 @@ @@ -135,8 +185,10 @@
135 </scroll-view> 185 </scroll-view>
136 <div class="bottomBtn" :style="{bottom: keyboardHeight+'rpx'}" @click="closeAllAlert"> 186 <div class="bottomBtn" :style="{bottom: keyboardHeight+'rpx'}" @click="closeAllAlert">
137 <div class="sayWhatInp"> 187 <div class="sayWhatInp">
138 - <image src="../../static/image/edit_comment.png" mode="" style="width: 32rpx;height: 32rpx;margin-right: 8rpx;"></image>  
139 - <input ref="remarkInp" class="inpTxt" type="text" v-model="content" placeholder="说点什么" :adjust-position="false"/> 188 + <image src="../../static/image/edit_comment.png" mode=""
  189 + style="width: 32rpx;height: 32rpx;margin-right: 8rpx;"></image>
  190 + <input ref="remarkInp" class="inpTxt" type="text" v-model="content" placeholder="说点什么"
  191 + :adjust-position="false" />
140 </div> 192 </div>
141 <text style="color: #969799;font-size: 32rpx;" @click="remark">发送</text> 193 <text style="color: #969799;font-size: 32rpx;" @click="remark">发送</text>
142 </div> 194 </div>
@@ -146,13 +198,16 @@ @@ -146,13 +198,16 @@
146 <div class="sendGift"> 198 <div class="sendGift">
147 <div class="giftPad"> 199 <div class="giftPad">
148 <div class="giftList"> 200 <div class="giftList">
149 - <div class="giftItem" v-for="(item,index) in giftList" :key="index" @click="chooseGift(index)"> 201 + <div class="giftItem" v-for="(item,index) in giftList" :key="index"
  202 + @click="chooseGift(index)">
150 <div class="giftImg"> 203 <div class="giftImg">
151 <div class="giftImgActive" :class="{active:giftIndex == index}"> 204 <div class="giftImgActive" :class="{active:giftIndex == index}">
152 <image style="width: 120rpx;height: 120rpx;" :src="item.image" mode=""></image> 205 <image style="width: 120rpx;height: 120rpx;" :src="item.image" mode=""></image>
153 </div> 206 </div>
154 - </div>  
155 - <div class="giftName"><text style="text-align: center;color: #e8c760;font-size: 28rpx;">{{item.price}}问野币</text></div> 207 + </div>
  208 + <div class="giftName"><text
  209 + style="text-align: center;color: #e8c760;font-size: 28rpx;">{{item.price}}问野币</text>
  210 + </div>
156 </div> 211 </div>
157 </div> 212 </div>
158 <div class="giftForm"> 213 <div class="giftForm">
@@ -163,7 +218,9 @@ @@ -163,7 +218,9 @@
163 <div class="inpItem"> 218 <div class="inpItem">
164 <div class="inpKey">数量</div> 219 <div class="inpKey">数量</div>
165 <div class="inpVal"> 220 <div class="inpVal">
166 - <input style="width: 200rpx;text-align: right;" type="number" @keyup="inpNum = inpNum.length === 1 ? inpNum.replace(/[^1-9]/g, '') : inpNum.replace(/\D/g, '')" v-model="inpNum" placeholder="请输入数量" placeholder-class="inpValPh"/> 221 + <input style="width: 200rpx;text-align: right;" type="number"
  222 + @keyup="inpNum = inpNum.length === 1 ? inpNum.replace(/[^1-9]/g, '') : inpNum.replace(/\D/g, '')"
  223 + v-model="inpNum" placeholder="请输入数量" placeholder-class="inpValPh" />
167 </div> 224 </div>
168 </div> 225 </div>
169 <div class="inpItem"> 226 <div class="inpItem">
@@ -172,30 +229,32 @@ @@ -172,30 +229,32 @@
172 </div> 229 </div>
173 </div> 230 </div>
174 <div class="bottomBtn" @click="sendGift"> 231 <div class="bottomBtn" @click="sendGift">
175 - <text style="text-align: center;line-height: 88rpx;font-size: 32rpx;color: #fff;">送出礼物</text> 232 + <text
  233 + style="text-align: center;line-height: 88rpx;font-size: 32rpx;color: #fff;">送出礼物</text>
176 </div> 234 </div>
177 </div> 235 </div>
178 <div class="closeBtn" @click="showSendGift = false"> 236 <div class="closeBtn" @click="showSendGift = false">
179 - <image style="width: 44rpx;height: 44rpx;" src="../../static/image/cross@2x.png" mode=""></image> 237 + <image style="width: 44rpx;height: 44rpx;" src="../../static/image/cross@2x.png" mode="">
  238 + </image>
180 </div> 239 </div>
181 </div> 240 </div>
182 </div> 241 </div>
183 <div class="shareBox" v-if="showShare"> 242 <div class="shareBox" v-if="showShare">
184 <div class="shareDialog"> 243 <div class="shareDialog">
185 - <div class="sharelist">  
186 - <div class="shareitem" @click="share('weixin','WXSceneSession')">  
187 - <div class="imgWrap">  
188 - <image class="shareImg" src="../../static/image/share-icon1.png" mode=""></image> 244 + <div class="sharelist">
  245 + <div class="shareitem" @click="share('weixin','WXSceneSession')">
  246 + <div class="imgWrap">
  247 + <image class="shareImg" src="../../static/image/share-icon1.png" mode=""></image>
  248 + </div>
  249 + <text style="text-align: center;line-height: 40rpx;font-size: 24rpx;">微信好友</text>
189 </div> 250 </div>
190 - <text style="text-align: center;line-height: 40rpx;font-size: 24rpx;">微信好友</text>  
191 - </div>  
192 - <div class="shareitem" @click="share('weixin','WXSenceTimeline')">  
193 - <div class="imgWrap">  
194 - <image class="shareImg" src="../../static/image/share-icon2.png" mode=""></image> 251 + <div class="shareitem" @click="share('weixin','WXSenceTimeline')">
  252 + <div class="imgWrap">
  253 + <image class="shareImg" src="../../static/image/share-icon2.png" mode=""></image>
  254 + </div>
  255 + <text style="text-align: center;line-height: 40rpx;font-size: 24rpx;">微信朋友圈</text>
195 </div> 256 </div>
196 - <text style="text-align: center;line-height: 40rpx;font-size: 24rpx;">微信朋友圈</text>  
197 - </div>  
198 - <!-- <div class="shareitem" @click="share('qq')"> 257 + <!-- <div class="shareitem" @click="share('qq')">
199 <image src="../static/share-icon3.png" mode=""></image> 258 <image src="../static/share-icon3.png" mode=""></image>
200 <text>QQ</text> 259 <text>QQ</text>
201 </div> 260 </div>
@@ -203,94 +262,112 @@ @@ -203,94 +262,112 @@
203 <image src="../static/share-icon4.png" mode=""></image> 262 <image src="../static/share-icon4.png" mode=""></image>
204 <text>微博</text> 263 <text>微博</text>
205 </div> --> 264 </div> -->
206 - </div>  
207 - <div class="cancelShare" @click="showShare = false">  
208 - <text style="font-size: 28rpx;line-height: 86rpx;text-align: center;">取消分享</text>  
209 - </div> 265 + </div>
  266 + <div class="cancelShare" @click="showShare = false">
  267 + <text style="font-size: 28rpx;line-height: 86rpx;text-align: center;">取消分享</text>
  268 + </div>
210 </div> 269 </div>
211 </div> 270 </div>
212 - </list> 271 + </list>
  272 + </div>
213 </template> 273 </template>
214 <script> 274 <script>
215 - const deviceInfo = uni.getSystemInfoSync() 275 + const deviceInfo = uni.getSystemInfoSync()
216 import canshu from './index.js' 276 import canshu from './index.js'
217 - import {mapState} from "vuex"  
218 - if(deviceInfo.brand=='Xiaomi'){  
219 - deviceInfo.windowHeight+=1 277 + import {
  278 + mapState
  279 + } from "vuex"
  280 + if (deviceInfo.brand == 'Xiaomi') {
  281 + deviceInfo.windowHeight += 1
220 } 282 }
221 // var apiUrl = 'http://landlord.t.brotop.cn/api' 283 // var apiUrl = 'http://landlord.t.brotop.cn/api'
222 var apiUrl = 'http://app.zhaodizhu.cn/api' 284 var apiUrl = 'http://app.zhaodizhu.cn/api'
223 export default { 285 export default {
224 data() { 286 data() {
225 return { 287 return {
226 - playIconStatus:false,  
227 - keyboardHeight:0,//键盘高度  
228 - showShare:false,  
229 - wallet:{},//我的钱包  
230 - inpNum:'',//输入礼物数量  
231 - giftIndex:-1,  
232 - showSendGift:false,  
233 - giftList:[],//礼物列表  
234 - showMoreHandle:false,  
235 - article_remark_id:'',  
236 - remarkType:'',  
237 - remarkQueryParam:{  
238 - article_id:'',  
239 - page:1,  
240 - pageNum:15 288 + sysheight:0,
  289 + height:'667px',
  290 +
  291 + background: ['color1', 'color2', 'color3'],
  292 + indicatorDots: true,
  293 + autoplay: true,
  294 + interval: 2000,
  295 + duration: 500,
  296 +
  297 + playIconStatus: false,
  298 + keyboardHeight: 0, //键盘高度
  299 + showShare: false,
  300 + wallet: {}, //我的钱包
  301 + inpNum: '', //输入礼物数量
  302 + giftIndex: -1,
  303 + showSendGift: false,
  304 + giftList: [], //礼物列表
  305 + showMoreHandle: false,
  306 + article_remark_id: '',
  307 + remarkType: '',
  308 + remarkQueryParam: {
  309 + article_id: '',
  310 + page: 1,
  311 + pageNum: 15
241 }, 312 },
242 - remarkList:[],  
243 - content:'',  
244 - article_id:'',  
245 - articleInfo:{},  
246 - scrollable:true,//是否允许List滚动  
247 - expandStatus:false,  
248 - showCommentAlert:false,//展示评论内容弹框  
249 - statusBarHeight:deviceInfo.statusBarHeight+'px', 313 + remarkList: [],
  314 + content: '',
  315 + article_id: '',
  316 + articleInfo: {},
  317 + scrollable: true, //是否允许List滚动
  318 + expandStatus: false,
  319 + showCommentAlert: false, //展示评论内容弹框
  320 + statusBarHeight: deviceInfo.statusBarHeight + 'px',
250 loadMoreHeight: deviceInfo.windowHeight * 2, // 触发 loadmore 事件所需要的垂直偏移距离 加载到剩余2 继续加载 321 loadMoreHeight: deviceInfo.windowHeight * 2, // 触发 loadmore 事件所需要的垂直偏移距离 加载到剩余2 继续加载
251 - videoStyle:{  
252 - width:"750rpx",  
253 - height:deviceInfo.windowHeight+'px',  
254 - },  
255 - lie:[],  
256 - nowId:0,  
257 - screenHeight:0,//屏幕高度  
258 - scrollTop:0,//滚动距离顶部距离  
259 - bofangjindu:0,  
260 - appear:'',  
261 - kebofang:0,  
262 - switchTab:'1',  
263 - plat:'android' 322 + videoStyle: {
  323 + width: "750rpx",
  324 + height: deviceInfo.windowHeight + 'px',
  325 + },
  326 + lie: [],
  327 + nowId: 0,
  328 + screenHeight: 0, //屏幕高度
  329 + scrollTop: 0, //滚动距离顶部距离
  330 + bofangjindu: 0,
  331 + appear: '',
  332 + kebofang: 0,
  333 + switchTab: '1',
  334 + plat: 'android'
264 } 335 }
265 - },  
266 - computed:{  
267 - ...mapState(["isLogin","userinfo","articleList"]),  
268 - jbNum(){  
269 - if(this.giftIndex != -1){ 336 + },
  337 + computed: {
  338 + ...mapState(["isLogin", "userinfo", "articleList"]),
  339 + jbNum() {
  340 + if (this.giftIndex != -1) {
270 return this.inpNum * this.giftList[this.giftIndex].price 341 return this.inpNum * this.giftList[this.giftIndex].price
271 } 342 }
272 } 343 }
273 }, 344 },
  345 + created(){
  346 + this.sysheight = uni.getSystemInfoSync().windowHeight
  347 + this.height = `${this.sysheight}px`
  348 + },
274 onLoad(e) { 349 onLoad(e) {
275 this.nowId = e.id 350 this.nowId = e.id
276 this.article_id = e.id 351 this.article_id = e.id
277 //监听键盘高度变化 352 //监听键盘高度变化
278 uni.onKeyboardHeightChange(res => { 353 uni.onKeyboardHeightChange(res => {
279 - if(res.height == 0){  
280 - this.keyboardHeight = 0  
281 - }else{  
282 - this.keyboardHeight = res.height*2 + 10  
283 - } 354 + if (res.height == 0) {
  355 + this.keyboardHeight = 0
  356 + } else {
  357 + this.keyboardHeight = res.height * 2 + 10
  358 + }
284 }) 359 })
285 //获取后台配置信息 360 //获取后台配置信息
286 uni.request({ 361 uni.request({
287 - url:apiUrl+'/common/getConfig',  
288 - method:'POST', 362 + url: apiUrl + '/common/getConfig',
  363 + method: 'POST',
289 header: { 364 header: {
290 - 'content-type': 'application/x-www-form-urlencoded', 365 + 'content-type': 'application/x-www-form-urlencoded',
291 'token': uni.getStorageSync('token') 366 'token': uni.getStorageSync('token')
292 }, 367 },
293 - data:{type:'8'}, 368 + data: {
  369 + type: '8'
  370 + },
294 success: (res) => { 371 success: (res) => {
295 this.switchTab = res.data.data.switch 372 this.switchTab = res.data.data.switch
296 this.plat = plus.os.name.toLowerCase() 373 this.plat = plus.os.name.toLowerCase()
@@ -302,16 +379,16 @@ @@ -302,16 +379,16 @@
302 this.screenHeight = res.screenHeight 379 this.screenHeight = res.screenHeight
303 } 380 }
304 }) 381 })
305 - 382 +
306 this.getData() 383 this.getData()
307 - 384 +
308 let lieArr = [] 385 let lieArr = []
309 let index = 0 386 let index = 0
310 let scrollTop = 0 387 let scrollTop = 0
311 - this.articleList.forEach((item)=>{  
312 - if(item.type == '2'){  
313 - if(item.id == this.nowId){  
314 - scrollTop = this.screenHeight*index 388 + this.articleList.forEach((item) => {
  389 + if (item.type == '2') {
  390 + if (item.id == this.nowId) {
  391 + scrollTop = this.screenHeight * index
315 } 392 }
316 lieArr.push(item) 393 lieArr.push(item)
317 index++ 394 index++
@@ -319,47 +396,49 @@ @@ -319,47 +396,49 @@
319 }) 396 })
320 this.scrollTop = scrollTop 397 this.scrollTop = scrollTop
321 this.lie = lieArr 398 this.lie = lieArr
322 - setTimeout(()=>{  
323 - uni.createVideoContext(`video_${this.nowId}`,this).play()  
324 - },200)  
325 - 399 + setTimeout(() => {
  400 + uni.createVideoContext(`video_${this.nowId}`, this).play()
  401 + }, 200)
  402 +
326 }, 403 },
327 onShow() { 404 onShow() {
328 - this.kebofang=1; 405 + this.kebofang = 1;
329 }, 406 },
330 - onHide(){  
331 - this.kebofang=0;  
332 - if(this.lie[this.index]){  
333 - uni.createVideoContext(`video_${this.index}`,this).pause()  
334 - } 407 + onHide() {
  408 + this.kebofang = 0;
  409 + if (this.lie[this.index]) {
  410 + uni.createVideoContext(`video_${this.index}`, this).pause()
  411 + }
335 }, 412 },
336 methods: { 413 methods: {
337 - getData(){ 414 + getData() {
338 uni.request({ 415 uni.request({
339 - url:apiUrl+'/article/info',  
340 - method:'POST', 416 + url: apiUrl + '/article/info',
  417 + method: 'POST',
341 header: { 418 header: {
342 - 'content-type': 'application/x-www-form-urlencoded', 419 + 'content-type': 'application/x-www-form-urlencoded',
343 'token': uni.getStorageSync('token') 420 'token': uni.getStorageSync('token')
344 }, 421 },
345 - data:{article_id:this.article_id}, 422 + data: {
  423 + article_id: this.article_id
  424 + },
346 success: (res) => { 425 success: (res) => {
347 - console.log('故事详情',res) 426 + console.log('故事详情', res)
348 this.articleInfo = res.data.data 427 this.articleInfo = res.data.data
349 } 428 }
350 }) 429 })
351 uni.request({ 430 uni.request({
352 - url:apiUrl+'/gift/lis',  
353 - method:'POST', 431 + url: apiUrl + '/gift/lis',
  432 + method: 'POST',
354 success: (res) => { 433 success: (res) => {
355 this.giftList = res.data.data 434 this.giftList = res.data.data
356 } 435 }
357 }) 436 })
358 uni.request({ 437 uni.request({
359 - url:apiUrl+'/wallet/index',  
360 - method:'POST', 438 + url: apiUrl + '/wallet/index',
  439 + method: 'POST',
361 header: { 440 header: {
362 - 'content-type': 'application/x-www-form-urlencoded', 441 + 'content-type': 'application/x-www-form-urlencoded',
363 'token': uni.getStorageSync('token') 442 'token': uni.getStorageSync('token')
364 }, 443 },
365 success: (res) => { 444 success: (res) => {
@@ -367,81 +446,86 @@ @@ -367,81 +446,86 @@
367 } 446 }
368 }) 447 })
369 }, 448 },
370 - Disappear(e,i){  
371 - if(this.appear==e.direction && deviceInfo.platform=='android'){  
372 - let index=(e.direction=='up')?i+1:i-1;  
373 - if(index >= 0){ 449 + Disappear(e, i) {
  450 + console.log('e', e)
  451 + console.log('i', i)
  452 + console.log('direction', (e.direction == 'up') ? i + 1 : i - 1)
  453 + console.log('this.lie', this.lie)
  454 + if (deviceInfo.platform == 'android' && e.direction != undefined) {
  455 + let index = (e.direction == 'up') ? i + 1 : i - 1;
  456 + console.log('index', index)
  457 + if (index >= 0) {
374 this.nowId = this.lie[index].id 458 this.nowId = this.lie[index].id
375 this.article_id = this.lie[index].id 459 this.article_id = this.lie[index].id
376 this.getData() 460 this.getData()
377 } 461 }
378 - setTimeout(()=>{  
379 - uni.createVideoContext(`video_${this.nowId}`,this).play()  
380 - },300)  
381 - } 462 + setTimeout(() => {
  463 + uni.createVideoContext(`video_${this.nowId}`, this).play()
  464 + }, 300)
  465 + }
382 }, 466 },
383 - onappear (e) {  
384 - this.appear=e.direction;  
385 - },  
386 - changeAskHandle(index){  
387 - this.remarkList.forEach(item=>{ 467 + onappear(e) {
  468 + this.appear = e.direction;
  469 + },
  470 + changeAskHandle(index) {
  471 + this.remarkList.forEach(item => {
388 item.showAskHandle = false 472 item.showAskHandle = false
389 }) 473 })
390 this.remarkList[index].showAskHandle = true 474 this.remarkList[index].showAskHandle = true
391 }, 475 },
392 //播放 476 //播放
393 - play(){ 477 + play() {
394 this.playStatus = true 478 this.playStatus = true
395 this.playIconStatus = false 479 this.playIconStatus = false
396 }, 480 },
397 //暂停 481 //暂停
398 - pause(){ 482 + pause() {
399 this.playStatus = false 483 this.playStatus = false
400 this.playIconStatus = true 484 this.playIconStatus = true
401 }, 485 },
402 - remarkInp(id,index){ 486 + remarkInp(id, index) {
403 this.article_remark_id = id 487 this.article_remark_id = id
404 this.remarkType = 'reply' 488 this.remarkType = 'reply'
405 this.$refs.remarkInp.focus() 489 this.$refs.remarkInp.focus()
406 }, 490 },
407 //去主页 491 //去主页
408 - goMainPage(userId){  
409 - if(userId == this.userinfo.id){ 492 + goMainPage(userId) {
  493 + if (userId == this.userinfo.id) {
410 uni.switchTab({ 494 uni.switchTab({
411 - url:'/pages/my/my' 495 + url: '/pages/my/my'
412 }) 496 })
413 - }else{  
414 - this.href('/pages/index/landHome?id='+userId) 497 + } else {
  498 + this.href('/pages/index/landHome?id=' + userId)
415 } 499 }
416 - 500 +
417 }, 501 },
418 - handleAsk(id,index,userId){ 502 + handleAsk(id, index, userId) {
419 this.remarkList[index].showAskHandle = false 503 this.remarkList[index].showAskHandle = false
420 - if(userId != this.userinfo.id){ 504 + if (userId != this.userinfo.id) {
421 uni.navigateTo({ 505 uni.navigateTo({
422 - url:'/pages/index/report?article_remark_id='+id 506 + url: '/pages/index/report?article_remark_id=' + id
423 }) 507 })
424 - }else{ 508 + } else {
425 uni.request({ 509 uni.request({
426 - url:apiUrl+'/article_remark/delRemark',  
427 - method:'POST', 510 + url: apiUrl + '/article_remark/delRemark',
  511 + method: 'POST',
428 header: { 512 header: {
429 - 'content-type': 'application/x-www-form-urlencoded', 513 + 'content-type': 'application/x-www-form-urlencoded',
430 'token': uni.getStorageSync('token') 514 'token': uni.getStorageSync('token')
431 }, 515 },
432 - data:{  
433 - article_remark_id:id 516 + data: {
  517 + article_remark_id: id
434 }, 518 },
435 success: (res) => { 519 success: (res) => {
436 - if(res.data.code == 1){ 520 + if (res.data.code == 1) {
437 this.getRemarkList() 521 this.getRemarkList()
438 uni.showToast({ 522 uni.showToast({
439 - title:'删除成功' 523 + title: '删除成功'
440 }) 524 })
441 - }else{ 525 + } else {
442 uni.showToast({ 526 uni.showToast({
443 - title:res.data.msg,  
444 - icon:'none' 527 + title: res.data.msg,
  528 + icon: 'none'
445 }) 529 })
446 } 530 }
447 } 531 }
@@ -449,102 +533,104 @@ @@ -449,102 +533,104 @@
449 } 533 }
450 }, 534 },
451 //关闭所有弹框 535 //关闭所有弹框
452 - closeAllAlert(i){  
453 - let videoPlay = uni.createVideoContext('video_'+i)  
454 - if(!this.showCommentAlert){  
455 - if(this.playStatus){ 536 + closeAllAlert(i) {
  537 + let videoPlay = uni.createVideoContext('video_' + i)
  538 + if (!this.showCommentAlert) {
  539 + if (this.playStatus) {
456 videoPlay.pause() 540 videoPlay.pause()
457 - }else{ 541 + } else {
458 videoPlay.play() 542 videoPlay.play()
459 } 543 }
460 } 544 }
461 this.showMoreHandle = false 545 this.showMoreHandle = false
462 - this.remarkList.forEach(item=>{ 546 + this.remarkList.forEach(item => {
463 item.showAskHandle = false 547 item.showAskHandle = false
464 }) 548 })
465 this.$forceUpdate() 549 this.$forceUpdate()
466 }, 550 },
467 //操作回复 551 //操作回复
468 - handleReply(id,index,userId){ 552 + handleReply(id, index, userId) {
469 this.remarkList[index].showReplyHandle = false 553 this.remarkList[index].showReplyHandle = false
470 uni.request({ 554 uni.request({
471 - url:apiUrl+'/article_reply/delReply',  
472 - method:'POST', 555 + url: apiUrl + '/article_reply/delReply',
  556 + method: 'POST',
473 header: { 557 header: {
474 - 'content-type': 'application/x-www-form-urlencoded', 558 + 'content-type': 'application/x-www-form-urlencoded',
475 'token': uni.getStorageSync('token') 559 'token': uni.getStorageSync('token')
476 }, 560 },
477 - data:{  
478 - article_reply_id:id 561 + data: {
  562 + article_reply_id: id
479 }, 563 },
480 success: (res) => { 564 success: (res) => {
481 - if(res.data.code == 1){ 565 + if (res.data.code == 1) {
482 this.getRemarkList() 566 this.getRemarkList()
483 uni.showToast({ 567 uni.showToast({
484 - title:'删除成功' 568 + title: '删除成功'
485 }) 569 })
486 - }else{ 570 + } else {
487 uni.showToast({ 571 uni.showToast({
488 - title:res.data.msg,  
489 - icon:'none' 572 + title: res.data.msg,
  573 + icon: 'none'
490 }) 574 })
491 } 575 }
492 } 576 }
493 }) 577 })
494 }, 578 },
495 - openAskHandle(index){ 579 + openAskHandle(index) {
496 this.remarkList[index].showAskHandle = true 580 this.remarkList[index].showAskHandle = true
497 this.article_remark_id = id 581 this.article_remark_id = id
498 this.remarkType = 'reply' 582 this.remarkType = 'reply'
499 this.$refs.remarkInp.focus() 583 this.$refs.remarkInp.focus()
500 }, 584 },
501 //分享 585 //分享
502 - share(parm1,parm2=''){ 586 + share(parm1, parm2 = '') {
503 //"weixin", "qq", "sinaweibo" 587 //"weixin", "qq", "sinaweibo"
504 // WXSceneSession 分享到聊天界面 588 // WXSceneSession 分享到聊天界面
505 // WXSenceTimeline 分享到朋友圈 589 // WXSenceTimeline 分享到朋友圈
506 // WXSceneFavorite 分享到微信收藏 590 // WXSceneFavorite 分享到微信收藏
507 uni.share({ 591 uni.share({
508 - provider:parm1,  
509 - title:"找地主",  
510 - scene:parm2,  
511 - type:0,  
512 - summary:"找地主测试描述",  
513 - href:"http://baidu.com",  
514 - imageUrl:"https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png" 592 + provider: parm1,
  593 + title: "找地主",
  594 + scene: parm2,
  595 + type: 0,
  596 + summary: "找地主测试描述",
  597 + href: "http://baidu.com",
  598 + imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png"
515 }) 599 })
516 }, 600 },
517 //删除帖子 601 //删除帖子
518 - delAct(){ 602 + delAct() {
519 uni.showModal({ 603 uni.showModal({
520 - title:'提示',  
521 - content:'确认删除吗?', 604 + title: '提示',
  605 + content: '确认删除吗?',
522 success: (res) => { 606 success: (res) => {
523 - if(res.confirm){ 607 + if (res.confirm) {
524 uni.request({ 608 uni.request({
525 - url:apiUrl + '/article/del',  
526 - method:'POST', 609 + url: apiUrl + '/article/del',
  610 + method: 'POST',
527 header: { 611 header: {
528 - 'content-type': 'application/x-www-form-urlencoded', 612 + 'content-type': 'application/x-www-form-urlencoded',
529 'token': uni.getStorageSync('token') 613 'token': uni.getStorageSync('token')
530 }, 614 },
531 - data:{article_id:this.article_id}, 615 + data: {
  616 + article_id: this.article_id
  617 + },
532 success: (res) => { 618 success: (res) => {
533 - if(res.data.code == 1){  
534 - uni.setStorageSync('refreshMy',true)  
535 - uni.setStorageSync('refreshFindWonderful',true) 619 + if (res.data.code == 1) {
  620 + uni.setStorageSync('refreshMy', true)
  621 + uni.setStorageSync('refreshFindWonderful', true)
536 uni.navigateBack({ 622 uni.navigateBack({
537 - delta:1 623 + delta: 1
538 }) 624 })
539 - setTimeout(()=>{ 625 + setTimeout(() => {
540 uni.showToast({ 626 uni.showToast({
541 - title:'删除成功' 627 + title: '删除成功'
542 }) 628 })
543 - },500)  
544 - }else{ 629 + }, 500)
  630 + } else {
545 uni.showToast({ 631 uni.showToast({
546 - title:res.msg,  
547 - icon:'none' 632 + title: res.msg,
  633 + icon: 'none'
548 }) 634 })
549 } 635 }
550 } 636 }
@@ -552,86 +638,86 @@ @@ -552,86 +638,86 @@
552 } 638 }
553 } 639 }
554 }) 640 })
555 - 641 +
556 }, 642 },
557 //送出礼物 643 //送出礼物
558 - sendGift(){  
559 - if(this.giftIndex == -1){ 644 + sendGift() {
  645 + if (this.giftIndex == -1) {
560 uni.showToast({ 646 uni.showToast({
561 - title:'请选择礼物',  
562 - icon:'none' 647 + title: '请选择礼物',
  648 + icon: 'none'
563 }) 649 })
564 return 650 return
565 } 651 }
566 - if(this.inpNum == '' || this.inpNum <= 0){ 652 + if (this.inpNum == '' || this.inpNum <= 0) {
567 uni.showToast({ 653 uni.showToast({
568 - title:'请输入正确数量',  
569 - icon:'none' 654 + title: '请输入正确数量',
  655 + icon: 'none'
570 }) 656 })
571 return 657 return
572 } 658 }
573 uni.request({ 659 uni.request({
574 - url:apiUrl+'/gift/give',  
575 - method:'POST', 660 + url: apiUrl + '/gift/give',
  661 + method: 'POST',
576 header: { 662 header: {
577 - 'content-type': 'application/x-www-form-urlencoded', 663 + 'content-type': 'application/x-www-form-urlencoded',
578 'token': uni.getStorageSync('token') 664 'token': uni.getStorageSync('token')
579 }, 665 },
580 - data:{  
581 - gift_id:this.giftList[this.giftIndex].id,  
582 - user_id:this.articleInfo.user.id,  
583 - number:this.inpNum 666 + data: {
  667 + gift_id: this.giftList[this.giftIndex].id,
  668 + user_id: this.articleInfo.user.id,
  669 + number: this.inpNum
584 }, 670 },
585 success: (res) => { 671 success: (res) => {
586 - if(res.data.code == 1){ 672 + if (res.data.code == 1) {
587 this.showSendGift = false 673 this.showSendGift = false
588 uni.showToast({ 674 uni.showToast({
589 - title:'送出礼物成功' 675 + title: '送出礼物成功'
590 }) 676 })
591 - }else{ 677 + } else {
592 uni.showToast({ 678 uni.showToast({
593 - title:res.data.msg,  
594 - icon:'none' 679 + title: res.data.msg,
  680 + icon: 'none'
595 }) 681 })
596 } 682 }
597 } 683 }
598 }) 684 })
599 }, 685 },
600 //选择礼物 686 //选择礼物
601 - chooseGift(index){ 687 + chooseGift(index) {
602 this.giftIndex = index 688 this.giftIndex = index
603 }, 689 },
604 //举报 690 //举报
605 - report(){ 691 + report() {
606 this.showMoreHandle = false 692 this.showMoreHandle = false
607 - if(this.articleInfo.user.id != this.userinfo.id){ 693 + if (this.articleInfo.user.id != this.userinfo.id) {
608 uni.navigateTo({ 694 uni.navigateTo({
609 - url:'/pages/index/report?article_id='+this.article_id 695 + url: '/pages/index/report?article_id=' + this.article_id
610 }) 696 })
611 - }else{ 697 + } else {
612 uni.navigateTo({ 698 uni.navigateTo({
613 - url:'/pages/findWonderful/publishPost?article_id='+this.article_id 699 + url: '/pages/findWonderful/publishPost?article_id=' + this.article_id
614 }) 700 })
615 } 701 }
616 }, 702 },
617 //回复 703 //回复
618 - reply(id,index){ 704 + reply(id, index) {
619 this.remarkList[index].showAskHandle = false 705 this.remarkList[index].showAskHandle = false
620 this.article_remark_id = id 706 this.article_remark_id = id
621 this.remarkType = 'reply' 707 this.remarkType = 'reply'
622 this.$refs.remarkInp.focus() 708 this.$refs.remarkInp.focus()
623 }, 709 },
624 //获取评论列表 710 //获取评论列表
625 - getRemarkList(){ 711 + getRemarkList() {
626 this.remarkQueryParam.article_id = this.article_id 712 this.remarkQueryParam.article_id = this.article_id
627 uni.request({ 713 uni.request({
628 - url:apiUrl+'/article_remark/getArticleList',  
629 - method:'POST', 714 + url: apiUrl + '/article_remark/getArticleList',
  715 + method: 'POST',
630 header: { 716 header: {
631 - 'content-type': 'application/x-www-form-urlencoded', 717 + 'content-type': 'application/x-www-form-urlencoded',
632 'token': uni.getStorageSync('token') 718 'token': uni.getStorageSync('token')
633 }, 719 },
634 - data:this.remarkQueryParam, 720 + data: this.remarkQueryParam,
635 success: (res) => { 721 success: (res) => {
636 this.remarkList = res.data.data.data 722 this.remarkList = res.data.data.data
637 this.showCommentAlert = true 723 this.showCommentAlert = true
@@ -639,108 +725,114 @@ @@ -639,108 +725,114 @@
639 }) 725 })
640 }, 726 },
641 //关注 727 //关注
642 - follow(userId){ 728 + follow(userId) {
643 uni.request({ 729 uni.request({
644 - url:apiUrl+'/user_follow_log/follow',  
645 - method:'POST', 730 + url: apiUrl + '/user_follow_log/follow',
  731 + method: 'POST',
646 header: { 732 header: {
647 - 'content-type': 'application/x-www-form-urlencoded', 733 + 'content-type': 'application/x-www-form-urlencoded',
648 'token': uni.getStorageSync('token') 734 'token': uni.getStorageSync('token')
649 }, 735 },
650 - data:{to_user_id:userId}, 736 + data: {
  737 + to_user_id: userId
  738 + },
651 success: (res) => { 739 success: (res) => {
652 - if(res.data.code == 1){ 740 + if (res.data.code == 1) {
653 this.getData() 741 this.getData()
654 uni.showToast({ 742 uni.showToast({
655 - title:res.data.msg + '成功' 743 + title: res.data.msg + '成功'
656 }) 744 })
657 - }else{ 745 + } else {
658 uni.showToast({ 746 uni.showToast({
659 - title:res.data.msg,  
660 - icon:'none' 747 + title: res.data.msg,
  748 + icon: 'none'
661 }) 749 })
662 } 750 }
663 } 751 }
664 }) 752 })
665 }, 753 },
666 //点赞 754 //点赞
667 - like(){ 755 + like() {
668 uni.request({ 756 uni.request({
669 - url:apiUrl+'/article/like',  
670 - method:'POST', 757 + url: apiUrl + '/article/like',
  758 + method: 'POST',
671 header: { 759 header: {
672 - 'content-type': 'application/x-www-form-urlencoded', 760 + 'content-type': 'application/x-www-form-urlencoded',
673 'token': uni.getStorageSync('token') 761 'token': uni.getStorageSync('token')
674 }, 762 },
675 - data:{article_id:this.article_id}, 763 + data: {
  764 + article_id: this.article_id
  765 + },
676 success: (res) => { 766 success: (res) => {
677 this.getData() 767 this.getData()
678 } 768 }
679 }) 769 })
680 }, 770 },
681 //收藏 771 //收藏
682 - collect(){ 772 + collect() {
683 uni.request({ 773 uni.request({
684 - url:apiUrl+'/article/collect',  
685 - method:'POST', 774 + url: apiUrl + '/article/collect',
  775 + method: 'POST',
686 header: { 776 header: {
687 - 'content-type': 'application/x-www-form-urlencoded', 777 + 'content-type': 'application/x-www-form-urlencoded',
688 'token': uni.getStorageSync('token') 778 'token': uni.getStorageSync('token')
689 }, 779 },
690 - data:{article_id:this.article_id}, 780 + data: {
  781 + article_id: this.article_id
  782 + },
691 success: (res) => { 783 success: (res) => {
692 this.getData() 784 this.getData()
693 } 785 }
694 }) 786 })
695 }, 787 },
696 //评论 788 //评论
697 - remark(){  
698 - if(this.remarkType == 'reply'){  
699 - if(this.content == ''){ 789 + remark() {
  790 + if (this.remarkType == 'reply') {
  791 + if (this.content == '') {
700 uni.showToast({ 792 uni.showToast({
701 - title:'请输入回复内容',  
702 - icon:'none' 793 + title: '请输入回复内容',
  794 + icon: 'none'
703 }) 795 })
704 return 796 return
705 } 797 }
706 uni.hideKeyboard() 798 uni.hideKeyboard()
707 uni.request({ 799 uni.request({
708 - url:apiUrl+'/article_reply/submitReply',  
709 - method:'POST', 800 + url: apiUrl + '/article_reply/submitReply',
  801 + method: 'POST',
710 header: { 802 header: {
711 - 'content-type': 'application/x-www-form-urlencoded', 803 + 'content-type': 'application/x-www-form-urlencoded',
712 'token': uni.getStorageSync('token') 804 'token': uni.getStorageSync('token')
713 }, 805 },
714 - data:{  
715 - article_remark_id:this.article_remark_id,  
716 - content:this.content 806 + data: {
  807 + article_remark_id: this.article_remark_id,
  808 + content: this.content
717 }, 809 },
718 success: (res) => { 810 success: (res) => {
719 this.content = '' 811 this.content = ''
720 this.remarkType = 'send' 812 this.remarkType = 'send'
721 - this.article_remark_id = '' 813 + this.article_remark_id = ''
722 this.getRemarkList() 814 this.getRemarkList()
723 } 815 }
724 }) 816 })
725 - }else{  
726 - if(this.content == ''){ 817 + } else {
  818 + if (this.content == '') {
727 uni.showToast({ 819 uni.showToast({
728 - title:'请输入评论内容',  
729 - icon:'none' 820 + title: '请输入评论内容',
  821 + icon: 'none'
730 }) 822 })
731 return 823 return
732 } 824 }
733 uni.hideKeyboard() 825 uni.hideKeyboard()
734 uni.request({ 826 uni.request({
735 - url:apiUrl+'/article_remark/submit',  
736 - method:'POST', 827 + url: apiUrl + '/article_remark/submit',
  828 + method: 'POST',
737 header: { 829 header: {
738 - 'content-type': 'application/x-www-form-urlencoded', 830 + 'content-type': 'application/x-www-form-urlencoded',
739 'token': uni.getStorageSync('token') 831 'token': uni.getStorageSync('token')
740 }, 832 },
741 - data:{  
742 - article_id:this.article_id,  
743 - content:this.content 833 + data: {
  834 + article_id: this.article_id,
  835 + content: this.content
744 }, 836 },
745 success: (res) => { 837 success: (res) => {
746 this.content = '' 838 this.content = ''
@@ -751,60 +843,60 @@ @@ -751,60 +843,60 @@
751 } 843 }
752 }, 844 },
753 //返回上一页 845 //返回上一页
754 - back(){ 846 + back() {
755 uni.navigateBack({ 847 uni.navigateBack({
756 - delta:1 848 + delta: 1
757 }) 849 })
758 }, 850 },
759 - changeExpand(){ 851 + changeExpand() {
760 this.expandStatus = !this.expandStatus 852 this.expandStatus = !this.expandStatus
761 }, 853 },
762 - dianzan(e){  
763 - if(e==0){  
764 - this.lie[this.index].yidianzan=1  
765 -  
766 -  
767 - this.lie[this.index].yidianzanshu= Number(this.lie[this.index].yidianzanshu) + 1  
768 - }else{  
769 - this.lie[this.index].yidianzan=0  
770 - this.lie[this.index].yidianzanshu= Number(this.lie[this.index].yidianzanshu)-1 854 + dianzan(e) {
  855 + if (e == 0) {
  856 + this.lie[this.index].yidianzan = 1
  857 +
  858 +
  859 + this.lie[this.index].yidianzanshu = Number(this.lie[this.index].yidianzanshu) + 1
  860 + } else {
  861 + this.lie[this.index].yidianzan = 0
  862 + this.lie[this.index].yidianzanshu = Number(this.lie[this.index].yidianzanshu) - 1
771 } 863 }
772 }, 864 },
773 - guanzhu(e){  
774 - if(e==0){  
775 - this.lie[this.index].guanzhu=1 865 + guanzhu(e) {
  866 + if (e == 0) {
  867 + this.lie[this.index].guanzhu = 1
776 uni.showToast({ 868 uni.showToast({
777 - title: '关注成功',  
778 - duration: 1500 869 + title: '关注成功',
  870 + duration: 1500
779 }); 871 });
780 - }else{  
781 - this.lie[this.index].guanzhu=0 872 + } else {
  873 + this.lie[this.index].guanzhu = 0
  874 + }
  875 + },
  876 +
  877 + panduanpofang() {
  878 + if (this.kebofang == 0) {
  879 + uni.createVideoContext(`video_${this.index}`, this).pause()
782 } 880 }
783 }, 881 },
784 -  
785 - panduanpofang(){  
786 - if(this.kebofang==0){  
787 - uni.createVideoContext(`video_${this.index}`,this).pause()  
788 - }  
789 - },  
790 - Timeupdate(e){  
791 - this.bofangjindu = parseInt(e.detail.currentTime/e.detail.duration*100) 882 + Timeupdate(e) {
  883 + this.bofangjindu = parseInt(e.detail.currentTime / e.detail.duration * 100)
792 }, 884 },
793 - Scroll(e){ 885 + Scroll(e) {
794 this.expandStatus = false 886 this.expandStatus = false
795 - if(deviceInfo.platform=='ios'){  
796 - var i=Math.abs(e.contentOffset.y/deviceInfo.windowHeight)  
797 - if(i!=this.index){  
798 - this.index=i  
799 - setTimeout(()=>{  
800 - uni.createVideoContext(`video_${this.index}`,this).play()  
801 - },300) 887 + if (deviceInfo.platform == 'ios') {
  888 + var i = Math.abs(e.contentOffset.y / deviceInfo.windowHeight)
  889 + if (i != this.index) {
  890 + this.index = i
  891 + setTimeout(() => {
  892 + uni.createVideoContext(`video_${this.index}`, this).play()
  893 + }, 300)
802 } 894 }
803 - } 895 + }
804 }, 896 },
805 - href(url){ 897 + href(url) {
806 uni.navigateTo({ 898 uni.navigateTo({
807 - url:url 899 + url: url
808 }) 900 })
809 } 901 }
810 } 902 }
@@ -812,13 +904,31 @@ @@ -812,13 +904,31 @@
812 </script> 904 </script>
813 905
814 <style lang="scss" scoped> 906 <style lang="scss" scoped>
815 - .zhi_index04{width:750upx;flex: 1;background-color: #000000;}  
816 - .zhi_index05{position: absolute;top: 0;left: 0;} 907 + .zhi_index04 {
  908 + width: 750upx;
  909 + flex: 1;
  910 + background-color: #000000;
  911 + }
  912 +
  913 + .zhi_index05 {
  914 + position: absolute;
  915 + top: 0;
  916 + left: 0;
  917 + }
  918 +
817 /* 导航栏区域 */ 919 /* 导航栏区域 */
818 - .navBarWrap{  
819 - position: absolute;height: 88rpx;width: 750rpx;top: 0;padding: 0 32rpx;flex-direction: row;justify-content: space-between;align-items: center; 920 + .navBarWrap {
  921 + position: absolute;
  922 + height: 88rpx;
  923 + width: 750rpx;
  924 + top: 0;
  925 + padding: 0 32rpx;
  926 + flex-direction: row;
  927 + justify-content: space-between;
  928 + align-items: center;
820 } 929 }
821 - .moreHandleWrap{ 930 +
  931 + .moreHandleWrap {
822 position: absolute; 932 position: absolute;
823 width: 168rpx; 933 width: 168rpx;
824 height: 72rpx; 934 height: 72rpx;
@@ -826,108 +936,299 @@ @@ -826,108 +936,299 @@
826 top: 105rpx; 936 top: 105rpx;
827 right: 46rpx; 937 right: 46rpx;
828 border-radius: 10rpx; 938 border-radius: 10rpx;
829 - .handleItem{ 939 +
  940 + .handleItem {
830 flex-direction: row; 941 flex-direction: row;
831 justify-content: center; 942 justify-content: center;
832 align-items: center; 943 align-items: center;
833 height: 72rpx; 944 height: 72rpx;
834 } 945 }
835 } 946 }
  947 +
836 /* 用户信息区域 */ 948 /* 用户信息区域 */
837 - .userInfoWrap{position: absolute;width: 750rpx;height: 100rpx;bottom: 200rpx;padding: 0 32rpx;flex-direction: row;justify-content: space-between;}  
838 - .userInfoWrap .userInfoLeft{flex-direction: row;align-items: center;}  
839 - .userInfoLeft .userIcon{width: 93rpx;}  
840 - .userInfoLeft .userNameAddress{padding-left: 9rpx;}  
841 - .userNameAddress .userAddress{flex-direction: row;align-items: center;}  
842 - .userInfoWrap .userInfoRight{flex-direction: row;align-items: center;justify-content: space-between;width: 260rpx;}  
843 - .userInfoRight .btnTxt{font-size: 22rpx;color: #fff;text-align: center;line-height: 52rpx;}  
844 - .userInfoRight .gzBtn{width: 122rpx;height: 52rpx;border: 1rpx solid #ffffff;border-radius: 103rpx;box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(63,63,64,0.37);}  
845 - .userInfoRight .lwBtn{width: 122rpx;height: 52rpx;background: #35655f;border-radius: 102rpx;box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(63,63,64,0.37); } 949 + .userInfoWrap {
  950 + position: absolute;
  951 + width: 750rpx;
  952 + height: 100rpx;
  953 + bottom: 200rpx;
  954 + padding: 0 32rpx;
  955 + flex-direction: row;
  956 + justify-content: space-between;
  957 + }
  958 +
  959 + .userInfoWrap .userInfoLeft {
  960 + flex-direction: row;
  961 + align-items: center;
  962 + }
  963 +
  964 + .userInfoLeft .userIcon {
  965 + width: 93rpx;
  966 + }
  967 +
  968 + .userInfoLeft .userNameAddress {
  969 + padding-left: 9rpx;
  970 + }
  971 +
  972 + .userNameAddress .userAddress {
  973 + flex-direction: row;
  974 + align-items: center;
  975 + }
  976 +
  977 + .userInfoWrap .userInfoRight {
  978 + flex-direction: row;
  979 + align-items: center;
  980 + justify-content: space-between;
  981 + width: 260rpx;
  982 + }
  983 +
  984 + .userInfoRight .btnTxt {
  985 + font-size: 22rpx;
  986 + color: #fff;
  987 + text-align: center;
  988 + line-height: 52rpx;
  989 + }
  990 +
  991 + .userInfoRight .gzBtn {
  992 + width: 122rpx;
  993 + height: 52rpx;
  994 + border: 1rpx solid #ffffff;
  995 + border-radius: 103rpx;
  996 + box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(63, 63, 64, 0.37);
  997 + }
  998 +
  999 + .userInfoRight .lwBtn {
  1000 + width: 122rpx;
  1001 + height: 52rpx;
  1002 + background: #35655f;
  1003 + border-radius: 102rpx;
  1004 + box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(63, 63, 64, 0.37);
  1005 + }
  1006 +
846 /* 展开内容区域 */ 1007 /* 展开内容区域 */
847 - .expandContentWrap{  
848 - position: fixed;width: 750rpx;height: 200rpx;bottom: 200rpx;flex-direction: column;padding: 0 32rpx; 1008 + .expandContentWrap {
  1009 + position: fixed;
  1010 + width: 750rpx;
  1011 + height: 200rpx;
  1012 + bottom: 200rpx;
  1013 + flex-direction: column;
  1014 + padding: 0 32rpx;
849 } 1015 }
  1016 +
850 /* 介绍区域 */ 1017 /* 介绍区域 */
851 - .contentWrap{position: absolute;bottom: 100rpx;padding: 0 32rpx;flex-direction: row;height: 100rpx;width: 750rpx;}  
852 - .contentWrap .content{flex: 1; 1018 + .contentWrap {
  1019 + position: absolute;
  1020 + bottom: 100rpx;
  1021 + padding: 0 32rpx;
  1022 + flex-direction: row;
  1023 + height: 100rpx;
  1024 + width: 750rpx;
  1025 + }
  1026 +
  1027 + .contentWrap .content {
  1028 + flex: 1;
853 overflow: hidden; 1029 overflow: hidden;
854 text-overflow: ellipsis; 1030 text-overflow: ellipsis;
855 } 1031 }
856 - .contentWrap .expandBtn{width: 70rpx;} 1032 +
  1033 + .contentWrap .expandBtn {
  1034 + width: 70rpx;
  1035 + }
  1036 +
857 /* 视频播放进度 */ 1037 /* 视频播放进度 */
858 - .zhi_index24{position: fixed;bottom: 100rpx;left: 0px;width: 750upx;} 1038 + .zhi_index24 {
  1039 + position: fixed;
  1040 + bottom: 100rpx;
  1041 + left: 0px;
  1042 + width: 750upx;
  1043 + }
  1044 +
859 /* 其他操作区域 */ 1045 /* 其他操作区域 */
860 - .otherHandleWrap{position: absolute;width: 750rpx;height:100rpx;bottom: 0;padding: 0 32rpx;flex-direction: row;justify-content: space-between;align-items: center;background-color: #000000;}  
861 - .otherHandleWrap .sayWhat{width: 238rpx;height: 64rpx;background: rgba(255,255,255,0.20);border-radius: 64rpx;flex-direction: row;padding-left: 24rpx;align-items: center;}  
862 - .otherHandleWrap .userHandle{flex-direction: row;align-items: center;}  
863 - .userHandle .handleImg{width: 42rpx;height: 42rpx;margin: 0 12rpx 0 24rpx;}  
864 - .userHandle .handleNum{color: rgba(255,255,255,0.60);font-size: 30rpx;} 1046 + .otherHandleWrap {
  1047 + position: absolute;
  1048 + width: 750rpx;
  1049 + height: 100rpx;
  1050 + bottom: 0;
  1051 + padding: 0 32rpx;
  1052 + flex-direction: row;
  1053 + justify-content: space-between;
  1054 + align-items: center;
  1055 + background-color: #000000;
  1056 + }
  1057 +
  1058 + .otherHandleWrap .sayWhat {
  1059 + width: 238rpx;
  1060 + height: 64rpx;
  1061 + background: rgba(255, 255, 255, 0.20);
  1062 + border-radius: 64rpx;
  1063 + flex-direction: row;
  1064 + padding-left: 24rpx;
  1065 + align-items: center;
  1066 + }
  1067 +
  1068 + .otherHandleWrap .userHandle {
  1069 + flex-direction: row;
  1070 + align-items: center;
  1071 + }
  1072 +
  1073 + .userHandle .handleImg {
  1074 + width: 42rpx;
  1075 + height: 42rpx;
  1076 + margin: 0 12rpx 0 24rpx;
  1077 + }
  1078 +
  1079 + .userHandle .handleNum {
  1080 + color: rgba(255, 255, 255, 0.60);
  1081 + font-size: 30rpx;
  1082 + }
  1083 +
865 /* 评论内容弹框 */ 1084 /* 评论内容弹框 */
866 - .commentAlert{position: fixed;width: 750rpx;height: 1000rpx;bottom: 0;background: #fff;border-radius: 30rpx 30rpx 0 0;}  
867 - .commentAlert .commentNum{height: 100rpx;position: relative;}  
868 - .commentNum .closeBtn{position: absolute;top:30rpx;right: 30rpx;}  
869 - .commentAlert .commentList{height: 800rpx;padding: 0 30rpx;}  
870 - .commentList .commentItem{flex-direction: row;padding: 10rpx 0;}  
871 - .commentItem .commentLeft{width: 93rpx;}  
872 - .commentItem .commentRight{width: 597rpx;padding-left: 13rpx;}  
873 - .commentRight .userNickName{flex-direction: row;justify-content: space-between;}  
874 - .commentList .commentSubItem{  
875 - flex-direction: row;padding: 10rpx 0 10rpx 106rpx;  
876 - .commentRight{  
877 - flex: 1;padding-left: 13rpx;  
878 - .userNickName{flex-direction: row;justify-content: space-between;} 1085 + .commentAlert {
  1086 + position: fixed;
  1087 + width: 750rpx;
  1088 + height: 1000rpx;
  1089 + bottom: 0;
  1090 + background: #fff;
  1091 + border-radius: 30rpx 30rpx 0 0;
  1092 + }
  1093 +
  1094 + .commentAlert .commentNum {
  1095 + height: 100rpx;
  1096 + position: relative;
  1097 + }
  1098 +
  1099 + .commentNum .closeBtn {
  1100 + position: absolute;
  1101 + top: 30rpx;
  1102 + right: 30rpx;
  1103 + }
  1104 +
  1105 + .commentAlert .commentList {
  1106 + height: 800rpx;
  1107 + padding: 0 30rpx;
  1108 + }
  1109 +
  1110 + .commentList .commentItem {
  1111 + flex-direction: row;
  1112 + padding: 10rpx 0;
  1113 + }
  1114 +
  1115 + .commentItem .commentLeft {
  1116 + width: 93rpx;
  1117 + }
  1118 +
  1119 + .commentItem .commentRight {
  1120 + width: 597rpx;
  1121 + padding-left: 13rpx;
  1122 + }
  1123 +
  1124 + .commentRight .userNickName {
  1125 + flex-direction: row;
  1126 + justify-content: space-between;
  1127 + }
  1128 +
  1129 + .commentList .commentSubItem {
  1130 + flex-direction: row;
  1131 + padding: 10rpx 0 10rpx 106rpx;
  1132 +
  1133 + .commentRight {
  1134 + flex: 1;
  1135 + padding-left: 13rpx;
  1136 +
  1137 + .userNickName {
  1138 + flex-direction: row;
  1139 + justify-content: space-between;
  1140 + }
879 } 1141 }
880 } 1142 }
881 - .askHandleWrap{ 1143 +
  1144 + .askHandleWrap {
882 width: 140rpx; 1145 width: 140rpx;
883 height: 100rpx; 1146 height: 100rpx;
884 border-radius: 10rpx; 1147 border-radius: 10rpx;
885 margin-left: 130rpx; 1148 margin-left: 130rpx;
886 border: 2rpx solid #35655f; 1149 border: 2rpx solid #35655f;
887 - .handleItem{ 1150 +
  1151 + .handleItem {
888 flex-direction: row; 1152 flex-direction: row;
889 justify-content: center; 1153 justify-content: center;
890 align-items: center; 1154 align-items: center;
891 height: 50rpx; 1155 height: 50rpx;
892 } 1156 }
893 } 1157 }
894 - .replyHandleWrap{ 1158 +
  1159 + .replyHandleWrap {
895 width: 140rpx; 1160 width: 140rpx;
896 height: 50rpx; 1161 height: 50rpx;
897 border-radius: 10rpx; 1162 border-radius: 10rpx;
898 margin-left: 236rpx; 1163 margin-left: 236rpx;
899 border: 2rpx solid #35655f; 1164 border: 2rpx solid #35655f;
900 - .handleItem{ 1165 +
  1166 + .handleItem {
901 flex-direction: row; 1167 flex-direction: row;
902 justify-content: center; 1168 justify-content: center;
903 align-items: center; 1169 align-items: center;
904 height: 50rpx; 1170 height: 50rpx;
905 } 1171 }
906 } 1172 }
907 - .commentAlert .bottomBtn{position: fixed;width: 750rpx;height: 100rpx;background: #ffffff;box-shadow: 0rpx -12rpx 14rpx 0rpx rgba(59,98,194,0.03);padding: 0 32rpx;flex-direction: row;align-items: center;justify-content: space-between;}  
908 - .bottomBtn .sayWhatInp{width: 590rpx;height: 64rpx;background: #f7f8fa;border-radius: 64rpx;flex-direction: row;align-items: center;padding-left: 20rpx;}  
909 - .sayWhatInp .inpTxt{width: 518rpx;height: 32rpx;font-size: 26rpx;}  
910 - 1173 +
  1174 + .commentAlert .bottomBtn {
  1175 + position: fixed;
  1176 + width: 750rpx;
  1177 + height: 100rpx;
  1178 + background: #ffffff;
  1179 + box-shadow: 0rpx -12rpx 14rpx 0rpx rgba(59, 98, 194, 0.03);
  1180 + padding: 0 32rpx;
  1181 + flex-direction: row;
  1182 + align-items: center;
  1183 + justify-content: space-between;
  1184 + }
  1185 +
  1186 + .bottomBtn .sayWhatInp {
  1187 + width: 590rpx;
  1188 + height: 64rpx;
  1189 + background: #f7f8fa;
  1190 + border-radius: 64rpx;
  1191 + flex-direction: row;
  1192 + align-items: center;
  1193 + padding-left: 20rpx;
  1194 + }
  1195 +
  1196 + .sayWhatInp .inpTxt {
  1197 + width: 518rpx;
  1198 + height: 32rpx;
  1199 + font-size: 26rpx;
  1200 + }
  1201 +
911 /* 送礼物弹框 */ 1202 /* 送礼物弹框 */
912 - .sendGiftAlert{  
913 - position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.5);  
914 - .sendGift{ 1203 + .sendGiftAlert {
  1204 + position: fixed;
  1205 + top: 0;
  1206 + left: 0;
  1207 + right: 0;
  1208 + bottom: 0;
  1209 + background: rgba(0, 0, 0, 0.5);
  1210 +
  1211 + .sendGift {
915 width: 750rpx; 1212 width: 750rpx;
916 position: absolute; 1213 position: absolute;
917 height: 630rpx; 1214 height: 630rpx;
918 bottom: 0; 1215 bottom: 0;
919 background: #fff; 1216 background: #fff;
920 border-radius: 50rpx 50rpx 0 0; 1217 border-radius: 50rpx 50rpx 0 0;
921 - .giftPad{ 1218 +
  1219 + .giftPad {
922 padding: 40rpx 32rpx 0 32rpx; 1220 padding: 40rpx 32rpx 0 32rpx;
923 - .giftList{ 1221 +
  1222 + .giftList {
924 flex-direction: row; 1223 flex-direction: row;
925 justify-content: center; 1224 justify-content: center;
926 - .giftItem{  
927 - .giftImg{ 1225 +
  1226 + .giftItem {
  1227 + .giftImg {
928 flex-direction: row; 1228 flex-direction: row;
929 justify-content: center; 1229 justify-content: center;
930 - .giftImgActive{ 1230 +
  1231 + .giftImgActive {
931 width: 150rpx; 1232 width: 150rpx;
932 height: 150rpx; 1233 height: 150rpx;
933 flex-direction: row; 1234 flex-direction: row;
@@ -935,28 +1236,33 @@ @@ -935,28 +1236,33 @@
935 justify-content: center; 1236 justify-content: center;
936 border-radius: 10rpx; 1237 border-radius: 10rpx;
937 } 1238 }
938 - .giftImgActive.active{ 1239 +
  1240 + .giftImgActive.active {
939 background: #e0e3ef; 1241 background: #e0e3ef;
940 } 1242 }
941 } 1243 }
942 } 1244 }
943 } 1245 }
944 - .giftForm{ 1246 +
  1247 + .giftForm {
945 padding: 32rpx; 1248 padding: 32rpx;
946 - .inpItem{ 1249 +
  1250 + .inpItem {
947 height: 88rpx; 1251 height: 88rpx;
948 flex-direction: row; 1252 flex-direction: row;
949 justify-content: space-between; 1253 justify-content: space-between;
950 align-items: center; 1254 align-items: center;
951 } 1255 }
952 } 1256 }
953 - .bottomBtn{  
954 - height:88rpx; 1257 +
  1258 + .bottomBtn {
  1259 + height: 88rpx;
955 background: #35655f; 1260 background: #35655f;
956 border-radius: 50rpx; 1261 border-radius: 50rpx;
957 } 1262 }
958 } 1263 }
959 - .closeBtn{ 1264 +
  1265 + .closeBtn {
960 position: absolute; 1266 position: absolute;
961 width: 44rpx; 1267 width: 44rpx;
962 height: 44rpx; 1268 height: 44rpx;
@@ -965,13 +1271,46 @@ @@ -965,13 +1271,46 @@
965 } 1271 }
966 } 1272 }
967 } 1273 }
  1274 +
968 /* 分享 */ 1275 /* 分享 */
969 - .shareBox{position: fixed;top:0;left:0;right:0;bottom:0;background: rgba(0,0,0,0.5);}  
970 - .shareDialog{width: 750rpx;height: 320rpx;background: #fff;position: absolute;bottom:0;}  
971 - .sharelist{flex-direction: row;margin:50rpx 0 44rpx;justify-content: center;}  
972 - .sharelist .shareitem{width: 187.5rpx;}  
973 - .shareitem .imgWrap{flex-direction: row;justify-content: center;}  
974 - .shareitem .shareImg{width: 100rpx;height: 100rpx;}  
975 - .cancelShare{border-top:1rpx solid #e5e5e5; 1276 + .shareBox {
  1277 + position: fixed;
  1278 + top: 0;
  1279 + left: 0;
  1280 + right: 0;
  1281 + bottom: 0;
  1282 + background: rgba(0, 0, 0, 0.5);
  1283 + }
  1284 +
  1285 + .shareDialog {
  1286 + width: 750rpx;
  1287 + height: 320rpx;
  1288 + background: #fff;
  1289 + position: absolute;
  1290 + bottom: 0;
  1291 + }
  1292 +
  1293 + .sharelist {
  1294 + flex-direction: row;
  1295 + margin: 50rpx 0 44rpx;
  1296 + justify-content: center;
  1297 + }
  1298 +
  1299 + .sharelist .shareitem {
  1300 + width: 187.5rpx;
  1301 + }
  1302 +
  1303 + .shareitem .imgWrap {
  1304 + flex-direction: row;
  1305 + justify-content: center;
  1306 + }
  1307 +
  1308 + .shareitem .shareImg {
  1309 + width: 100rpx;
  1310 + height: 100rpx;
  1311 + }
  1312 +
  1313 + .cancelShare {
  1314 + border-top: 1rpx solid #e5e5e5;
976 } 1315 }
977 </style> 1316 </style>
@@ -10,132 +10,221 @@ @@ -10,132 +10,221 @@
10 {{item.price}}元 10 {{item.price}}元
11 </view> 11 </view>
12 </view> 12 </view>
13 - <view class="recItem" > 13 + <!-- <view class="recItem">
14 <view class="recVal"> 14 <view class="recVal">
15 - <input type="number" v-model="custNum" placeholder="自定义" style="width: 50%;text-align: center;" placeholder-style="font-size:28rpx;color:#4a8b94;"/> 15 + <input type="number" v-model="custNum" placeholder="自定义" style="width: 50%;text-align: center;"
  16 + placeholder-style="font-size:28rpx;color:#4a8b94;" />
16 </view> 17 </view>
17 <view class="recPrice" style="font-weight: 600;" @click="custom"> 18 <view class="recPrice" style="font-weight: 600;" @click="custom">
18 立即充值 19 立即充值
19 </view> 20 </view>
20 - </view> 21 + </view> -->
21 </view> 22 </view>
22 <navigator url="aboutUs"></navigator> 23 <navigator url="aboutUs"></navigator>
23 <view class="agreeCont"> 24 <view class="agreeCont">
24 - <!-- <checkbox color="#4a8b94"/> -->充值即代表您同意<text @click="$href('aboutUs?navTitle=问野币充值协议')">《问野币充值协议》</text> 25 + <!-- <checkbox color="#4a8b94"/> -->充值即代表您同意<text
  26 + @click="$href('aboutUs?navTitle=问野币充值协议')">《问野币充值协议》</text>
25 </view> 27 </view>
26 <!-- 游侠付款弹框 --> 28 <!-- 游侠付款弹框 -->
27 - <pay-type v-if="showPay" @pay="pay" @changePayType="changePayType" :price="price" @closePayAlert="showPay = false"></pay-type> 29 + <pay-type v-if="showPay" @pay="pay" @changePayType="changePayType" :price="price"
  30 + @closePayAlert="showPay = false"></pay-type>
28 </view> 31 </view>
29 </template> 32 </template>
30 33
31 <script> 34 <script>
32 import payType from '@/components/payType.vue' 35 import payType from '@/components/payType.vue'
33 - export default{  
34 - data(){  
35 - return{  
36 - custNum:'',  
37 - param:{  
38 - number:'',//问野币数量  
39 - pay_type:'wechat' 36 + export default {
  37 + data() {
  38 + return {
  39 + custNum: '',
  40 + id: '',
  41 + param: {
  42 + number: '', //问野币数量
  43 + pay_type: 'wechat'
40 }, 44 },
41 - showPay:false,//展示支付弹框  
42 - price:0,  
43 - list:[  
44 - {  
45 - num:10,  
46 - price:1 45 + showPay: false, //展示支付弹框
  46 + price: 0,
  47 + list: [{
  48 + num: 10,
  49 + price: 1,
  50 + id: 'S3FKBIR',
47 }, 51 },
48 { 52 {
49 - num:50,  
50 - price:5 53 + num: 60,
  54 + price: 6,
  55 + id: 'K93MD8T',
51 }, 56 },
52 { 57 {
53 - num:100,  
54 - price:10 58 + num: 120,
  59 + price: 12,
  60 + id: 'TR5CNJF',
55 }, 61 },
56 { 62 {
57 - num:200,  
58 - price:20 63 + num: 250,
  64 + price: 25,
  65 + id: 'AIDHZK4',
59 }, 66 },
60 { 67 {
61 - num:500,  
62 - price:50 68 + num: 500,
  69 + price: 50,
  70 + id: '87FC0DH',
63 } 71 }
64 ] 72 ]
65 } 73 }
66 }, 74 },
67 - components:{ 75 + components: {
68 payType 76 payType
69 }, 77 },
70 onLoad() { 78 onLoad() {
71 uni.getProvider({ 79 uni.getProvider({
72 - service: 'payment',  
73 - success: function (res) {  
74 -  
75 - console.log('获取通道',res.provider)  
76 - } 80 + service: 'payment',
  81 + success: function(res) {
  82 + console.log('获取通道', res.provider)
  83 + }
77 }); 84 });
  85 +
  86 + console.log('查看支付通道')
  87 + plus.payment.getChannels((channels) => {
  88 + console.log('判断是否是苹果支付',channels)
  89 + for (var i in channels) {
  90 + // 判断是否苹果支付
  91 + if (channels[i].id === 'appleiap') {
  92 + that.iapChannel = channels[i]
  93 + that.requestOrder()
  94 + } else {
  95 + // that.payment()
  96 + that.requestOrder()
  97 + }
  98 + }
  99 + })
78 }, 100 },
79 - methods:{ 101 + methods: {
80 //修改支付类型 102 //修改支付类型
81 - changePayType(e){  
82 - console.log('修改支付类型',e) 103 + changePayType(e) {
  104 + console.log('修改支付类型', e)
83 this.param.pay_type = e 105 this.param.pay_type = e
84 }, 106 },
85 //显示支付类型选择弹框 107 //显示支付类型选择弹框
86 - showPayType(index){ 108 + showPayType(index) {
87 this.price = this.list[index].price 109 this.price = this.list[index].price
88 this.param.number = this.list[index].num 110 this.param.number = this.list[index].num
  111 + this.id = this.list[index].id
89 this.param.pay_type = 'wechat' 112 this.param.pay_type = 'wechat'
90 this.showPay = true 113 this.showPay = true
91 }, 114 },
92 - custom(){  
93 - if(this.custNum == '' || this.custNum <= 0){ 115 + custom() {
  116 + if (this.custNum == '' || this.custNum <= 0) {
94 uni.showToast({ 117 uni.showToast({
95 - title:'请输入正确的问野币数量',  
96 - icon:'none' 118 + title: '请输入正确的问野币数量',
  119 + icon: 'none'
97 }) 120 })
98 return 121 return
99 } 122 }
100 let flag = new RegExp("^[1-9]([0-9])*$").test(this.custNum); 123 let flag = new RegExp("^[1-9]([0-9])*$").test(this.custNum);
101 - if(!flag){ 124 + if (!flag) {
102 uni.showToast({ 125 uni.showToast({
103 - title:'请输入正确的问野币数量',  
104 - icon:'none' 126 + title: '请输入正确的问野币数量',
  127 + icon: 'none'
105 }) 128 })
106 return 129 return
107 } 130 }
108 this.param.number = this.custNum 131 this.param.number = this.custNum
109 - this.price = this.param.number/10 132 + this.price = this.param.number / 10
110 this.showPay = true 133 this.showPay = true
111 }, 134 },
112 - pay(){  
113 - this.payment() 135 + pay() {
  136 + const that = this
  137 + uni.showLoading({
  138 + title: '检测支付环境...',
  139 + mask: true
  140 + })
  141 + plus.payment.getChannels((channels) => {
  142 + console.log('判断是否是苹果支付',channels)
  143 + for (var i in channels) {
  144 + // 判断是否苹果支付
  145 + if (channels[i].id === 'appleiap') {
  146 + that.iapChannel = channels[i]
  147 + that.requestOrder()
  148 + } else {
  149 + // that.payment()
  150 + that.requestOrder()
  151 + }
  152 + }
  153 + })
114 }, 154 },
115 - async payment(){  
116 - var orderInfo=await this.getOrderInfo(); 155 + async payment() {
  156 + console.log('安卓')
  157 + var orderInfo = await this.getOrderInfo();
117 uni.requestPayment({ 158 uni.requestPayment({
118 - provider: this.param.pay_type == 'wechat' ? 'wxpay' : 'alipay',  
119 - orderInfo: this.param.pay_type == 'wechat' ? orderInfo.data : orderInfo.data.body,//this.param.pay_type == 'wechat' ? JSON.stringify(orderInfo.data) : orderInfo.data, //微信、支付宝订单数据  
120 - success: (e) => { 159 + provider: this.param.pay_type == 'wechat' ? 'wxpay' : 'alipay',
  160 + orderInfo: this.param.pay_type == 'wechat' ? orderInfo.data : orderInfo.data
  161 + .body, //this.param.pay_type == 'wechat' ? JSON.stringify(orderInfo.data) : orderInfo.data, //微信、支付宝订单数据
  162 + success: (e) => {
121 uni.navigateBack({ 163 uni.navigateBack({
122 - delta:1 164 + delta: 1
123 }) 165 })
124 - setTimeout(()=>{ 166 + setTimeout(() => {
125 uni.showToast({ 167 uni.showToast({
126 - title:'充值成功' 168 + title: '充值成功'
127 }) 169 })
128 - },500)  
129 - },  
130 - fail: function (err) {  
131 - console.log('充值失败',err) 170 + }, 500)
  171 + },
  172 + fail: function(err) {
  173 + console.log('充值失败', err)
132 } 174 }
133 }); 175 });
134 }, 176 },
135 - getOrderInfo(){  
136 - return new Promise((reslove)=>{  
137 - this.$request('/wallet/recharge',this.param).then((res)=>{  
138 - console.log('充值问野币',res) 177 + requestOrder() {
  178 + const that = this
  179 + // ['xxxxx'] 是平台申请拿到的内购商品的id
  180 + console.log('苹果支付')
  181 + that.iapChannel.requestOrder([this.id],
  182 + function(event) {
  183 + uni.hideLoading()
  184 + console.log('苹果支付',event)
  185 + for (var index in event) {
  186 + var OrderItem = event[index]
  187 + console.log(OrderItem)
  188 + that.topay(OrderItem.productid)
  189 + }
  190 + },
  191 + function(erroemsg) {
  192 + uni.hideLoading()
  193 + uni.showToast({
  194 + title: "获取支付通道失败:" + errormsg.message,
  195 + icon: 'none'
  196 + })
  197 + })
  198 + },
  199 + topay(id) {
  200 + const that = this
  201 + uni.showLoading({
  202 + title: '充值中请勿离开',
  203 + mask: true
  204 + })
  205 + uni.requestPayment({
  206 + provider: 'appleiap',
  207 + orderInfo: {
  208 + productid: id
  209 + },
  210 + success: (res => {
  211 + uni.hideLoading()
  212 + var orderInfo = this.getOrderInfo();
  213 + }),
  214 + fail: (e) => {
  215 + uni.hideLoading()
  216 + uni.showModal({
  217 + content: "支付失败",
  218 + showCancel: false
  219 + })
  220 + }
  221 + })
  222 +
  223 + },
  224 + getOrderInfo() {
  225 + return new Promise((reslove) => {
  226 + this.$request('/wallet/recharge', this.param).then((res) => {
  227 + console.log('充值问野币', res)
139 reslove(res) 228 reslove(res)
140 }) 229 })
141 }) 230 })
@@ -145,42 +234,65 @@ @@ -145,42 +234,65 @@
145 </script> 234 </script>
146 235
147 <style lang="scss" scoped> 236 <style lang="scss" scoped>
148 - page{background: #f8f8f9;}  
149 - .topLine{height: 2rpx;background: rgba(25,24,51,0.06);}  
150 - .recList{  
151 - padding:0 32rpx; 237 + page {
  238 + background: #f8f8f9;
  239 + }
  240 +
  241 + .topLine {
  242 + height: 2rpx;
  243 + background: rgba(25, 24, 51, 0.06);
  244 + }
  245 +
  246 + .recList {
  247 + padding: 0 32rpx;
152 display: flex; 248 display: flex;
153 flex-wrap: wrap; 249 flex-wrap: wrap;
154 - .recItem{ 250 +
  251 + .recItem {
155 width: 218rpx; 252 width: 218rpx;
156 height: 240rpx; 253 height: 240rpx;
157 background: #ffffff; 254 background: #ffffff;
158 border-radius: 24rpx; 255 border-radius: 24rpx;
159 - box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0,0,0,0.06);  
160 - margin:24rpx 16rpx 0 0;  
161 - .recVal{  
162 - padding-top: 64rpx;  
163 - display: flex;  
164 - justify-content: center;  
165 - align-items: center;  
166 - color: #4a8b94;  
167 - text{font-size: 40rpx;} 256 + box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0, 0, 0, 0.06);
  257 + margin: 24rpx 16rpx 0 0;
  258 +
  259 + .recVal {
  260 + padding-top: 64rpx;
  261 + display: flex;
  262 + justify-content: center;
  263 + align-items: center;
  264 + color: #4a8b94;
  265 +
  266 + text {
  267 + font-size: 40rpx;
  268 + }
168 } 269 }
169 - .recPrice{ 270 +
  271 + .recPrice {
170 padding-top: 16rpx; 272 padding-top: 16rpx;
171 text-align: center; 273 text-align: center;
172 font-size: 28rpx; 274 font-size: 28rpx;
173 } 275 }
174 } 276 }
175 - .recItem:nth-of-type(3n){margin-right: 0;} 277 +
  278 + .recItem:nth-of-type(3n) {
  279 + margin-right: 0;
  280 + }
176 } 281 }
177 - .agreeCont{  
178 - checkbox{transform: scale(0.7);} 282 +
  283 + .agreeCont {
  284 + checkbox {
  285 + transform: scale(0.7);
  286 + }
  287 +
179 padding-top: 42rpx; 288 padding-top: 42rpx;
180 font-size: 28rpx; 289 font-size: 28rpx;
181 display: flex; 290 display: flex;
182 align-items: center; 291 align-items: center;
183 justify-content: center; 292 justify-content: center;
184 - text{color: #4a8b94;} 293 +
  294 + text {
  295 + color: #4a8b94;
  296 + }
185 } 297 }
186 </style> 298 </style>