Browse Source

1,对接接口

master
1263428893@qq.com 5 months ago
parent
commit
ea71069f7a
16 changed files with 462 additions and 101 deletions
  1. +8
    -1
      common/api.js
  2. +1
    -0
      common/config.js
  3. +6
    -6
      manifest.json
  4. +11
    -0
      pages.json
  5. +27
    -12
      pages/auth/index.vue
  6. +53
    -1
      pages/home/index.vue
  7. +24
    -0
      pages/index/index.vue
  8. +45
    -35
      pages/login/index.vue
  9. +8
    -3
      pages/reservation/index.vue
  10. +10
    -5
      pages/user/index.vue
  11. +20
    -13
      pages_subpack/business/index.vue
  12. +39
    -6
      pages_subpack/category/index.vue
  13. +119
    -2
      pages_subpack/detail/index.vue
  14. +58
    -5
      pages_subpack/invite/index.vue
  15. +1
    -3
      pages_subpack/person/index.vue
  16. +32
    -9
      pages_subpack/recommend/index.vue

+ 8
- 1
common/api.js View File

@ -14,7 +14,7 @@ export const wxLogin = (params) => http.get('/api/login/login', {params:params})
// 微信登录接口
export const appletLogin = (params) => http.get('/carrent-admin/api/login/login', {params:params})
// 用户信息
export const getInfo = (params) => http.post('/carrent-admin/api/user/queryUser', params)
export const getInfo = (params) => http.get('/carrent-admin/api/user/queryUser', {params:params})
// 用户注册
export const addUser = (params) => http.post('/carrent-admin/api/user/addUser', params)
// 企业注册
@ -68,6 +68,13 @@ export const queryCategoryTwoList = (params) => http.get('/carrent-admin/api/con
// 我的推荐-获取个人邀请码
export const getInviteCode = (params) => http.get('/carrent-admin/api/recommend/getInviteCode', {params:params})
// 我的推荐-获取推荐用户信息
export const getInviteUser = (params) => http.get('/carrent-admin/api/recommend/getInviteUser', {params:params})
// 配置信息-获取公里数列表
export const queryMileageList = (params) => http.get('/carrent-admin/api/config/queryMileageList', {params:params})
export const bindPhone = (params) => http.get('/carrent-admin/api/login/bindPhone', {params:params})
export const updateUser = (params) => http.post('/carrent-admin/api/user/updateUser', params)

+ 1
- 0
common/config.js View File

@ -3,4 +3,5 @@ module.exports = {
// baseUrl: 'http://augcl.natapp1.cc/employ-api'
baseUrl:"https://carrentadmin.augcl.com"
// baseUrl:"http://augcl.natapp1.cc"
}

+ 6
- 6
manifest.json View File

@ -97,12 +97,12 @@
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx1c95690b8180a150",
"permission" : {
"scope.userLocation" : {
"desc" : "将获取你的具体位置信息,用于帮助用户浏览所在位置的零活信息"
}
},
"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ],
"permission" : {
"scope.userLocation" : {
"desc" : "将获取你的具体位置信息,用于帮助用户浏览所在位置的零活信息"
}
},
"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ],
"setting" : {
"urlCheck" : false,
"es6" : false,


+ 11
- 0
pages.json View File

@ -6,6 +6,17 @@
"navigationBarTitleText": "环卫车",
"navigationStyle":"default",
"navigationBarBackgroundColor": "#669A32",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": true,
"onReachBottomDistance": 100
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "index",
"navigationStyle":"default",
"navigationBarBackgroundColor": "#669A32",
"navigationBarTextStyle": "white"
}
},


+ 27
- 12
pages/auth/index.vue View File

@ -99,7 +99,7 @@
iv:event.detail.iv,
nickName:event.detail.userInfo.nickName,
session_key:"",
shareId:uni.getStorageSync('userId'),
shareId:uni.getStorageSync('shareId'),
vid:""
}
appletLogin(params).then((response) => {
@ -108,19 +108,34 @@
uni.setStorageSync('token', response.result.token)
uni.setStorageSync('sessionKey', response.result.userInfo.sessionKey)
uni.setStorageSync('userInfo', response.result.userInfo)
// that.commit('setUserInfo',{userInfo:response.result.userInfo,token:response.result.token})
getInfo({id:response.result.userInfo.id}).then(result=>{
// console.info('resultresult',result)
uni.navigateTo({
url:"/pages/login/index"
})
// if(result.result.nickName){
// uni.switchTab({
// url:"/pages/home/index"
// })
// }else{
// }
uni.setStorageSync("companyAuthenticationStatus",result.result.companyAuthenticationStatus)
uni.setStorageSync("personAuthenticationStatus",result.result.personAuthenticationStatus)
console.info('resultresult',result)
// uni.navigateTo({
// url:"/pages/login/index"
// })
if(!result.result.memberInfo.phone){
uni.navigateTo({
url:"/pages/login/index"
})
}else{
if(result.result.companyAuthenticationStatus==-1 && result.result.personAuthenticationStatus==-1){
uni.navigateTo({
url:"/pages/identity/index"
})
}else{
uni.switchTab({
url:"/pages/home/index"
})
}
}
}).catch(err=>{
})


+ 53
- 1
pages/home/index.vue View File

@ -43,7 +43,7 @@
</view>
<view class="se-grid-2">
<view class="items-box se-br-5 se-px-10" v-for="(items,indexs) in list" :key="indexs" @click="onDetail(items)">
<image class="se-w-p-100 se-h-200 se-py-5" :src="items.image" mode=""></image>
<image class="se-w-p-100 se-h-200 se-bgc-f5 se-br-5 se-py-5" :src="items.images[0]" mode=""></image>
<view class="se-c-black se-fs-24 se-fw-6 se-mt-10">
{{ items.goodsName }}
</view>
@ -120,6 +120,13 @@
}
},
onLoad(options) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
if(options.shareId){
uni.setStorageSync('shareId',options.shareId)
}
this.onPageList()
this.getLocation()
this.onQueryBannerList()
@ -135,6 +142,19 @@
that.pageNo = that.pageNo + 1
that.onPageList()
},
onShareAppMessage() {
let share = {
path:"/pages/home/index?shareId="+uni.getStorageSync('userInfo').id,
success:(res) => {
console.info(res)
},
fail:(err)=>{
console.info(err)
}
}
console.info(share)
return share
},
methods:{
onSearch(){
uni.navigateTo({
@ -196,6 +216,38 @@
}
queryGoodsList(params).then((response) => {
console.info('queryGoodsList',response)
response.result.records.forEach((items,indexs)=>{
if(items.image){
items.images = items.image.split(',')
}else{
items.images = []
}
if(items.imageBack){
items.imageBacks = items.imageBack.split(',')
}else{
items.imageBacks = []
}
if(items.imageCab){
items.imageCabs = items.imageCab.split(',')
}else{
items.imageCabs = []
}
if(items.imageFront){
items.imageFronts = items.imageFront.split(',')
}else{
items.imageFronts = []
}
if(items.imageLeft){
items.imageLefts = items.imageLeft.split(',')
}else{
items.imageLefts = []
}
if(items.imageRight){
items.imageRights = items.imageRight.split(',')
}else{
items.imageRights = []
}
})
that.list = that.list.concat(response.result.records)
}).catch((error) =>{


+ 24
- 0
pages/index/index.vue View File

@ -0,0 +1,24 @@
<template>
<view></view>
</template>
<script>
export default{
components:{
},
data(){
return{
}
},
onLoad(options) {
if(options.shareId){
uni.setStorageSync('shareId',options.shareId)
uni.switchTab({
url:"/pages/home/index"
})
}
}
}
</script>

+ 45
- 35
pages/login/index.vue View File

@ -40,7 +40,7 @@
</template>
<script>
// import { UpdateInfo,bindPhone } from "@/common/api.js"
import { bindPhone,updateUser } from "@/common/api.js"
export default {
name : 'Login',
data() {
@ -48,16 +48,20 @@
nameUser:"",
imagUrl:"",
phone:"",
back:0
back:0,
companyAuthenticationStatus:"",
personAuthenticationStatus:"",
}
},
onLoad(options) {
// if(options.back==1){
// this.imagUrl = uni.getStorageSync('userInfo').headImage
// this.nameUser = uni.getStorageSync('userInfo').nickName
// this.phone = uni.getStorageSync('userInfo').phone
// this.back = options.back
// }
this.companyAuthenticationStatus=uni.getStorageSync("companyAuthenticationStatus")
this.personAuthenticationStatus=uni.getStorageSync("personAuthenticationStatus")
this.imagUrl = uni.getStorageSync('userInfo').headImage
this.nameUser = uni.getStorageSync('userInfo').nickName
this.phone = uni.getStorageSync('userInfo').phone
if(options.back==1){
this.back = options.back
}
},
methods: {
bindblur(event) {
@ -74,7 +78,7 @@
var detail = event.detail;
if(detail.errMsg=='getPhoneNumber:ok'){
let params={
code : detail.code,
phoneCode : detail.code,
encryptedData: detail.encryptedData,
iv:detail.iv,
sessionKey: uni.getStorageSync('sessionKey'),
@ -82,7 +86,8 @@
}
bindPhone(params).then((response) => {
console.info(response)
that.phone = response.result
let obj = JSON.parse(response.result)
that.phone = obj.phone_info.phoneNumber
}).catch(error=>{
})
@ -91,34 +96,39 @@
onUpdateInfo(){
let that = this
let params={
avatarUrl:that.imagUrl,
headImage:that.imagUrl,
nickName:that.nameUser,
// phone:that.phone
phone:that.phone
}
uni.navigateTo({
url:"/pages/identity/index"
})
// &&that.phone
// if(that.imagUrl&&that.nameUser){
// UpdateInfo(params).then((response) => {
// if(this.back==1){
// uni.navigateBack({
// delta:1
// })
// }else{
// uni.switchTab({
// url:"/pages/home/index"
// })
// }
// }).catch((error) =>{
if(that.imagUrl&&that.nameUser&&that.phone){
updateUser(params).then((response) => {
if(this.back==1){
uni.navigateBack({
delta:1
})
}else{
if(that.companyAuthenticationStatus==-1 && that.personAuthenticationStatus==-1){
uni.navigateTo({
url:"/pages/identity/index"
})
}else{
uni.switchTab({
url:"/pages/home/index"
})
}
// uni.switchTab({
// url:"/pages/home/index"
// })
}
}).catch((error) =>{
// })
// }else{
// return uni.showToast({
// icon:"none",
// title:""
// })
// }
})
}else{
return uni.showToast({
icon:"none",
title:"头像和昵称手机号,不能为空!"
})
}
}


+ 8
- 3
pages/reservation/index.vue View File

@ -21,8 +21,7 @@
</view>
<view class="se-flex">
<view class="se-w-160 se-h-160">
<image class="se-w-160 se-h-160 se-br-10" src="https://cdn.uviewui.com/uview/album/1.jpg"
mode=""></image>
<image class="se-w-160 se-h-160 se-bgc-f5 se-br-10" :src="items.carrentGoods.images[0]" mode=""></image>
</view>
<view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
<view class="se-fw-6 se-c-black se-fs-30 se-display-ib">客户名称{{items.name}}</view>
@ -102,8 +101,14 @@
}
queryOrderList(params).then(response=>{
console.info("queryOrderList",response)
response.result.records.forEach((items,indexs)=>{
if(items.carrentGoods.image){
items.carrentGoods.images = items.carrentGoods.image.split(',')
}else{
items.carrentGoods.images = []
}
})
that.list = response.result.records
}).catch(error=>{
})


+ 10
- 5
pages/user/index.vue View File

@ -2,14 +2,14 @@
<view class="u-page">
<view class="se-pt-50 se-pb-40 se-px-40 se-bgc-green se-c-white se-pos">
<view class="se-flex">
<image :src="user.cerImage" class="se-br-p-50 se-w-100 se-h-100 se-bgc-f5" mode=""></image>
<image :src="user.headImage" class="se-br-p-50 se-w-100 se-h-100 se-bgc-f5" mode=""></image>
<view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
<view class="se-flex">
<text class="se-fw-6 se-fs-30">{{user.name}}</text>
<!-- <view class="se-flex se-flex-ai-c se-ml-20">
<text class="se-fw-6 se-fs-30">{{user.nickName}}</text>
<view class="se-flex se-flex-ai-c se-ml-20" @click="toNav()">
<image class="se-a-25 se-mr-10" src="@/static/image/pencil.png" mode=""></image>
<text class="se-fs-22">修改资料</text>
</view> -->
</view>
</view>
<view class="se-fs-24 se-display-ib">
<text>手机号:</text>
@ -112,7 +112,7 @@
let that = this
getInfo({id:uni.getStorageSync('userInfo').id}).then(response=>{
console.info('resultresult',response)
that.user = response.result
that.user = response.result.memberInfo
}).catch(err=>{
})
@ -179,6 +179,11 @@
})
},
toNav(){
uni.navigateTo({
url:"/pages/login/index"
})
},
onCustomerService(){
let that = this
// let obj = that.$utils.getkeyContent('phone')


+ 20
- 13
pages_subpack/business/index.vue View File

@ -52,19 +52,26 @@
data(){
return{
form: {
name: 'jerryxiao',
mobile: '13189698114',
company:'小肖公司',
address:'湖南长沙市岳麓区',
file: '1',
fileList:[
{
url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png"
},
{
url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png"
}
],
name: '',
mobile: '',
company:'',
address:'',
file: '',
fileList:[],
// name: 'jerryxiao',
// mobile: '13189698114',
// company:'',
// address:'',
// file: '1',
// fileList:[
// {
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/7e98056b-e0b9-496f-89f8-88026ce9426e.png"
// },
// {
// url:"https://tennis-oss.xzaiyp.top/2024-12-14/499fcd8a-3d4b-42f3-b023-61bac6b1c020.png"
// }
// ],
},
rules: {
name: [{


+ 39
- 6
pages_subpack/category/index.vue View File

@ -15,8 +15,9 @@
<text class="se-mr-10" v-else>时间</text>
<u-icon name="arrow-down-fill" color="#666666"></u-icon>
</view>
<view class="se-flex-1 se-flex se-flex-h-c">
<text class="se-mr-10">公里数</text>
<view class="se-flex-1 se-flex se-flex-h-c" @click="handleMileageChange()">
<text class="se-mr-10" v-if="mileageName">{{mileageName}}</text>
<text class="se-mr-10" v-else>公里数</text>
<u-icon name="arrow-down-fill" color="#666666"></u-icon>
</view>
</view>
@ -24,7 +25,7 @@
<view class="se-grid-2 se-pt-200">
<view class="items-box se-br-5 se-px-10" v-for="(items,indexs) in list" :key="indexs" @click="onDetail(items)">
<image class="se-w-p-100 se-h-200 se-py-5" :src="items.image" mode=""></image>
<image class="se-w-p-100 se-h-200 se-bgc-f5 se-br-5 se-py-5" :src="items.image" mode=""></image>
<view class="se-c-black se-fs-24 se-fw-6 se-mt-10">
{{ items.goodsName }}
</view>
@ -48,6 +49,7 @@
</view>
<u-empty v-if="list && list.length==0" mode="list"></u-empty>
<u-action-sheet :actions="categoryTwoList" @select="selectCategoryTwoClick" title="分类" :show="categoryTwoShow" @close="categoryTwoClose"></u-action-sheet>
<u-action-sheet :actions="mileageList" @select="selectMileageClick" title="公里数" :show="mileageShow" @close="MileageClose"></u-action-sheet>
<u-datetime-picker
:show="showDate"
v-model="date"
@ -59,10 +61,11 @@
</template>
<script>
import { queryGoodsList,queryCategoryTwoList } from "@/common/api.js"
import { queryGoodsList,queryCategoryTwoList,queryMileageList } from "@/common/api.js"
export default{
data(){
return{
mileageShow:false,
showDate:false,
goodsName:null,
id:null,
@ -72,6 +75,9 @@
categorytwoId:null,
categorytwoName:null,
categoryTwoList:[],
mileageId:null,
mileageName:null,
mileageList:[],
pageNo:1,
list:[],
}
@ -82,6 +88,7 @@
}
this.onPageList()
this.onQueryCategoryTwoList()
this.onQueryMileageList()
},
onPullDownRefresh() {
let that = this
@ -116,10 +123,22 @@
this.categoryTwoShow = true
},
categoryTwoClose(){
this.categorytwoId = null
this.categorytwoName = null
this.categoryTwoShow = false
this.pageNo = 1
},
handleMileageChange(){
this.mileageShow = true
},
MileageClose(){
this.mileageShow = false
this.pageNo = 1
},
selectMileageClick(event){
console.info("selectMileageClick",event)
this.mileageId = event.id
this.mileageName = event.mileage
this.mileageShow = false
this.pageNo = 1
this.onPageList()
},
selectCategoryTwoClick(event){
@ -142,6 +161,19 @@
})
},
onQueryMileageList(){
let that = this
let params = {}
queryMileageList(params).then(response=>{
console.info("queryMileageList",response)
response.result.forEach(items=>{
items.name = items.mileage
})
that.mileageList = response.result
}).catch(error=>{
})
},
onSearch(){
this.pageNo = 1
this.onPageList()
@ -151,6 +183,7 @@
let params={
cartypeId:that.id,
categorytwoId:that.categorytwoId,
mileage:that.mileageName,
goodsTime:that.goodsTime,
goodsName:that.goodsName,
pageNo:that.pageNo,


+ 119
- 2
pages_subpack/detail/index.vue View File

@ -1,7 +1,7 @@
<template>
<view>
<view class="se-w-vw-100 se-h-500">
<u-swiper :radius="0" :list="list" :height="250" :autoplay="false"></u-swiper>
<u-swiper :radius="0" :list="detail.images" :height="250" :autoplay="false"></u-swiper>
</view>
<view class="se-py-20 se-flex se-bgc-white">
<view class="se-w-vw-90 se-pl-30">
@ -24,11 +24,51 @@
<text>型号:</text>
<text class="se-ml-10">{{detail.model}}</text>
</view>
<template v-if="detail.imageFronts && detail.imageFronts.length>0">
<view class="se-mt-20 se-bgc-white se-px-20 se-py-10 se-ta-l se-c-black se-py-20 se-flex se-flex-ai-c se-fs-24">
<text>车辆照片:</text>
</view>
<view class="se-flex se-m-20" style="flex-wrap: wrap;">
<image v-for="(items,indexs) in detail.imageFronts" :key="indexs" @click="previewImage(detail.imageBacks,items)" class="se-w-220 se-h-180 se-bgc-f5 se-br-5 se-mr-10 se-mb-10" :src="items" mode=""></image>
</view>
</template>
<template v-if="detail.imageBacks && detail.imageBacks.length>0">
<view class="se-mt-20 se-bgc-white se-px-20 se-py-10 se-ta-l se-c-black se-py-20 se-flex se-flex-ai-c se-fs-24">
<text>车辆照片:</text>
</view>
<view class="se-flex se-m-20" style="flex-wrap: wrap;">
<image v-for="(items,indexs) in detail.imageBacks" :key="indexs" @click="previewImage(detail.imageBacks,items)" class="se-w-220 se-h-180 se-bgc-f5 se-br-5 se-mr-10 se-mb-10" :src="items" mode=""></image>
</view>
</template>
<template v-if="detail.imageLefts && detail.imageLefts.length>0">
<view class="se-mt-20 se-bgc-white se-px-20 se-py-10 se-ta-l se-c-black se-py-20 se-flex se-flex-ai-c se-fs-24">
<text>车辆照片:</text>
</view>
<view class="se-flex se-m-20" style="flex-wrap: wrap;">
<image v-for="(items,indexs) in detail.imageLefts" :key="indexs" @click="previewImage(detail.imageLefts,items)" class="se-w-220 se-h-180 se-bgc-f5 se-br-5 se-mr-10 se-mb-10" :src="items" mode=""></image>
</view>
</template>
<template v-if="detail.imageRights && detail.imageRights.length>0">
<view class="se-mt-20 se-bgc-white se-px-20 se-py-10 se-ta-l se-c-black se-py-20 se-flex se-flex-ai-c se-fs-24">
<text>车辆照片:</text>
</view>
<view class="se-flex se-m-20" style="flex-wrap: wrap;">
<image v-for="(items,indexs) in detail.imageRights" :key="indexs" @click="previewImage(detail.imageRights,items)" class="se-w-220 se-h-180 se-bgc-f5 se-br-5 se-mr-10 se-mb-10" :src="items" mode=""></image>
</view>
</template>
<template v-if="detail.imageCabs && detail.imageCabs.length>0">
<view class="se-mt-20 se-bgc-white se-px-20 se-py-10 se-ta-l se-c-black se-py-20 se-flex se-flex-ai-c se-fs-24">
<text>车辆照片驾驶室:</text>
</view>
<view class="se-flex se-m-20" style="flex-wrap: wrap;">
<image v-for="(items,indexs) in detail.imageCabs" :key="indexs" @click="previewImage(detail.imageCabs,items)" class="se-w-220 se-h-180 se-bgc-f5 se-br-5 se-mr-10 se-mb-10" :src="items" mode=""></image>
</view>
</template>
<view class="se-pt-20">
<view class="se-p-20 se-c-black se-fs-28">
产品参数
</view>
<view>
<view class="se-p-20 se-pb-200">
<u-parse :content="detail.detail"></u-parse>
</view>
</view>
@ -128,10 +168,56 @@
}
},
onLoad(options) {
//#ifdef MP-WEIXIN
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
//#endif
this.id = options.goodsId
if(options.shareId){
uni.setStorageSync('shareId',options.shareId)
}
this.onDetail()
},
onShareTimeline(){
let share = {
title:this.detail.goodsName,
path:"/pages_subpack/detail/index?id="+this.id+"&shareId="+uni.getStorageSync('userInfo').id,
imageUrl:this.list[0].url,
success:(res) => {
console.info(res)
},
fail:(err)=>{
console.info(err)
}
}
console.info(share)
return share
},
onShareAppMessage(options) {
console.info(options)
let share = {
title:this.detail.goodsName,
path:"/pages_subpack/detail/index?id="+this.id+"&shareId="+uni.getStorageSync('userInfo').id,
imageUrl:this.list[0].url,
success:(res) => {
console.info(res)
},
fail:(err)=>{
console.info(err)
}
}
console.info(share)
return share
},
methods:{
previewImage(urls, current) {
uni.previewImage({
urls: urls, // HTTP
current: current // urls
});
},
onDetail(){
let that = this
queryGoodsById({goodsId:that.id}).then(response=>{
@ -145,6 +231,37 @@
})
})
}
if(items.image){
items.images = items.image.split(',')
}else{
items.images = []
}
if(items.imageBack){
items.imageBacks = items.imageBack.split(',')
}else{
items.imageBacks = []
}
if(items.imageCab){
items.imageCabs = items.imageCab.split(',')
}else{
items.imageCabs = []
}
if(items.imageFront){
items.imageFronts = items.imageFront.split(',')
}else{
items.imageFronts = []
}
if(items.imageLeft){
items.imageLefts = items.imageLeft.split(',')
}else{
items.imageLefts = []
}
if(items.imageRight){
items.imageRights = items.imageRight.split(',')
}else{
items.imageRights = []
}
that.detail = items
}).catch(error=>{


+ 58
- 5
pages_subpack/invite/index.vue View File

@ -2,8 +2,9 @@
<view class="se-p-60">
<view class="se-p-40 se-flex se-bgc-white se-br-20 se-bs se-flex-v-sa">
<text class="se-pb-50 se-pt-100">邀请好友</text>
<image class="se-a-300 se-br-20" src="https://cdn.uviewui.com/uview/swiper/swiper1.png" mode=""></image>
<text class="se-pt-50 se-pb-80">邀请码TKAFGED</text>
<image class="se-a-300 se-br-20" :src="qrcode" mode=""></image>
<text class="se-pt-50 se-pb-80">邀请码{{shareId}} </text>
<!-- 邀请码TKAFGED -->
</view>
<view class="se-px-100 se-pt-80 se-fs-20 se-flex">
<view @click="onSubmit"
@ -19,7 +20,8 @@
export default {
data() {
return {
qrcode:"",
shareId:""
}
},
watch: {
@ -34,13 +36,64 @@
let params={}
getInviteCode(params).then(response=>{
console.info("getInviteCode",response)
that.qrcode = response.result.url
that.shareId = response.result.shareId
}).catch(error=>{
})
},
onSubmit(){
console.info("保存成功")
}
const url = this.qrcode;
//
uni.downloadFile({
url, //
success: (res) => {
if (res.statusCode === 200) {
//
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: () => {
uni.showToast({
title: '图片保存成功',
icon: 'success',
});
},
fail: (err) => {
if (err.errMsg.includes('auth')) {
//
uni.showModal({
title: '授权提示',
content: '需要授权保存图片到相册,是否前往设置授权?',
success: (res) => {
if (res.confirm) {
uni.openSetting();
}
},
});
} else {
uni.showToast({
title: '保存失败',
icon: 'none',
});
}
},
});
} else {
uni.showToast({
title: '图片下载失败',
icon: 'none',
});
}
},
fail: () => {
uni.showToast({
title: '图片下载失败',
icon: 'none',
});
},
});
},
},
onReady() {


+ 1
- 3
pages_subpack/person/index.vue View File

@ -53,9 +53,7 @@
idCard:'',
mobile: '',
file: '',
fileList:[
]
fileList:[]
},
rules: {
name: [{


+ 32
- 9
pages_subpack/recommend/index.vue View File

@ -1,23 +1,40 @@
<template>
<view>
<view class="se-px-20 se-py-20 se-bgc-white">
<u-tabs :activeStyle="{
<u-tabs :current="current" :activeStyle="{
color: '#669A32',
transform: 'scale(1.05)'
}" lineColor="#669A32" :list="list" @click="onClick"></u-tabs>
</view>
<view class="se-m-20">
<view class="se-bgc-white se-br-20 se-p-20 se-mb-20 se-flex" v-for="(items,indexs) in 20" :key="indexs">
<image class="se-a-80 se-br-p-50" src="https://cdn.uviewui.com/uview/swiper/swiper1.png" mode=""></image>
<view class="se-m-20" v-if="current==0">
<view class="se-bgc-white se-br-20 se-p-20 se-mb-20 se-flex" v-for="(items,indexs) in directUserList" :key="indexs">
<image class="se-a-80 se-br-p-50 se-bgc-f5" :src="items.headImage" mode=""></image>
<view class="se-flex se-flex-v se-flex-1 se-px-20">
<view class="se-c-black se-fw-6 se-fs-26 se-toe-1 se-pt-5">
用户138400*******
{{items.nickName}}
<text v-if="items.phone">-{{items.phone}}</text>
</view>
<view class="se-c-33 se-fs-24 se-lh-40 se-toe-3 se-pt-10">
加入100天
{{$u.timeFormat(items.createTime, 'yyyy年mm月dd日')}}加入
</view>
</view>
</view>
<u-empty v-if="directUserList && directUserList.length==0" mode="list"></u-empty>
</view>
<view class="se-m-20" v-if="current==1">
<view class="se-bgc-white se-br-20 se-p-20 se-mb-20 se-flex" v-for="(items,indexs) in indirectUserList" :key="indexs">
<image class="se-a-80 se-br-p-50 se-bgc-f5" :src="items.headImage" mode=""></image>
<view class="se-flex se-flex-v se-flex-1 se-px-20">
<view class="se-c-black se-fw-6 se-fs-26 se-toe-1 se-pt-5">
{{items.nickName}}
<text v-if="items.phone">-{{items.phone}}</text>
</view>
<view class="se-c-33 se-fs-24 se-lh-40 se-toe-3 se-pt-10">
{{$u.timeFormat(items.createTime, 'yyyy年mm月dd日')}}加入
</view>
</view>
</view>
<u-empty v-if="indirectUserList && indirectUserList.length==0" mode="list"></u-empty>
</view>
</view>
</template>
@ -27,13 +44,16 @@
export default {
data(){
return{
current:0,
list:[
{
name: '直接用户',
}, {
name: '间推用户',
}
]
],
directUserList:[],
indirectUserList:[]
}
},
watch: {
@ -48,12 +68,15 @@
let params ={}
getInviteUser(params).then(response=>{
console.info("getInviteUser",response)
that.directUserList = response.result.directUserList
that.indirectUserList = response.result.indirectUserList
}).catch(error=>{
})
},
onClick(index){
console.info(index)
onClick(event){
// console.info(event)
this.current = event.index
}
}
}


Loading…
Cancel
Save