dengjie commit : 首页产品列表下拉刷新分页展示产品
This commit is contained in:
@@ -61,19 +61,18 @@
|
||||
swiperList: [],
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// this.$refs.getProducts.query.pageNum = 1
|
||||
// this.$refs.getProducts.productList = []
|
||||
|
||||
onReachBottom() {
|
||||
// console.log('pageNum===', this.$refs.getProducts);
|
||||
this.$refs.getProducts.pageNum += 1
|
||||
this.$refs.getProducts.getProducts()
|
||||
|
||||
//关闭下拉刷新
|
||||
uni.stopPullDownRefresh()
|
||||
// uni.stopPullDownRefresh()
|
||||
},
|
||||
onLoad() {
|
||||
this.getCategories()
|
||||
this.getBanner()
|
||||
this.getImgUrl()
|
||||
// this.$refs.getProducts.getProducts()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
||||
获取电话号码</u-button>
|
||||
</view>
|
||||
<view>
|
||||
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
||||
获取电话号码</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {loginSys} from '@/service/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getphonenumber(e) {
|
||||
const {
|
||||
phoneCode
|
||||
} = e.detail;
|
||||
console.log("手机code : ", phoneCode);
|
||||
uni.login({
|
||||
"provider": "weixin",
|
||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||
success: function(event) {
|
||||
const {
|
||||
code
|
||||
} = event
|
||||
|
||||
console.log("登录code", code);
|
||||
//客户端成功获取授权临时票据(code),向业务服务器发起登录请求。
|
||||
|
||||
|
||||
// 调用登录接口 拿到token 传手机code,更新手机号码
|
||||
loginSys(code).then(res=>{
|
||||
console.log(res);
|
||||
|
||||
|
||||
|
||||
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
|
||||
//接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
// 登录授权失败
|
||||
// err.code是错误码
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
import {
|
||||
loginSys
|
||||
} from '@/service/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getphonenumber(e) {
|
||||
const {
|
||||
phoneCode
|
||||
} = e.detail;
|
||||
console.log("手机code : ", phoneCode);
|
||||
uni.login({
|
||||
"provider": "weixin",
|
||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||
success: function(event) {
|
||||
const {
|
||||
code
|
||||
} = event
|
||||
|
||||
console.log("登录code", code);
|
||||
//客户端成功获取授权临时票据(code),向业务服务器发起登录请求。
|
||||
|
||||
|
||||
// 调用登录接口 拿到token 传手机code,更新手机号码
|
||||
loginSys(code).then(res => {
|
||||
console.log(res);
|
||||
|
||||
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
|
||||
//接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
// 登录授权失败
|
||||
// err.code是错误码
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user