Commit b328ad64 authored by 和慭琛's avatar 和慭琛

Merge branch 'dev-photo-tools'

parents 492ce968 af75b2f0
This diff is collapsed.
'use strict';
exports.main = async (event, context) => {
const db = uniCloud.database();
let res = await db.collection("standard").where(event).get();
let data = res.data
const map = new Map()
for(let i = 0; i < data.length; i++){
let key = data[i].type
if(map.has(key)){
data[i].images = data[i].images.split(",")
map.get(key).list.push(data[i])
}else{
data[i].images = data[i].images.split(",")
map.set(key,{type:key, list:[data[i]]})
}
}
return [...map.values()]
};
...@@ -13,10 +13,14 @@ const db = uniCloud.database({ ...@@ -13,10 +13,14 @@ const db = uniCloud.database({
/* 查询规范项目 {product_code:"P0001"}*/ /* 查询规范项目 {product_code:"P0001"}*/
let getstandard = async (params = {}) => await db.collection("standard").where(params).get(); let getstandard = async (params = {}) => await db.collection("standard").where(params).get();
/* 查询分组规范项目 */
let getGroupStandard = async (params = {}) => await uniCloud.callFunction({name: 'getGroupStandard', data: params});
const rulesApi = { const rulesApi = {
getAllProduct, getAllProduct,
getBrand, getBrand,
getstandard, getstandard,
getGroupStandard,
} }
return rulesApi return rulesApi
} }
......
{ {
"name" : "take-order", "name" : "take-order",
"appid" : "", "appid" : "__UNI__BA775F5",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "", "appid" : "wxd1d6eede324b0465",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -14,24 +15,51 @@ ...@@ -14,24 +15,51 @@
}, },
{ {
"path": "pages/photo/product", "path": "pages/photo/product",
"style": { "style": {
"navigationBarTitleText": "选择产品" "navigationBarTitleText": "扳手会工单规范"
} }
}, },
{
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "拍照",
"navigationBarBackgroundColor":"#333333",
"navigationBarTextStyle":"#FFFFFF",
"app-plus": {//app平台
"bounce": "none"//禁止滚动
}
}
},
{ {
"path": "pages/photo/detail", "path": "pages/photo/detail",
"style": { "style": {
"navigationBarTitleText": "图片展示" "navigationBarTitleText": "图片展示",
"navigationBarBackgroundColor":"#333333",
"navigationBarTextStyle":"#FFFFFF"
} }
}, },
{
"path": "pages/photo/preview",
"style": {
"navigationBarTitleText": "照片预览"
}
},
{ {
"path": "pages/photo/list", "path": "pages/photo/list",
"style": { "style": {
...@@ -47,15 +75,13 @@ ...@@ -47,15 +75,13 @@
{ {
"path": "pages/photo/brand", "path": "pages/photo/brand",
"style": { "style": {
"navigationBarTitleText": "选择品牌" "navigationBarTitleText": "扳手会工单规范"
} }
}, },
{ {
"path": "pages/photo/try", "path": "pages/photo/take",
"style": { "style": {
"navigationBarTitleText": "拍照" "navigationBarTitleText": "拍照-ljd"
} }
}, },
...@@ -63,12 +89,9 @@ ...@@ -63,12 +89,9 @@
{
"path": "pages/photo/preview",
"style": {
"navigationBarTitleText": "照片预览"
}
},
// { // {
// "path": "pages/photo/index", // "path": "pages/photo/index",
...@@ -88,13 +111,13 @@ ...@@ -88,13 +111,13 @@
{ // {
"path": "pages/take/index", // "path": "pages/take/try",
"style": { // "style": {
"navigationBarTitleText": "接单", // "navigationBarTitleText": "接单",
"enablePullDownRefresh": true // "enablePullDownRefresh": true
} // }
}, // },
...@@ -115,6 +138,13 @@ ...@@ -115,6 +138,13 @@
}, },
{
"path": "pages/take/index",
"style": {
"navigationBarTitleText": "接单"
}
},
{ {
"path": "pages/take/finish", "path": "pages/take/finish",
"style": { "style": {
...@@ -179,9 +209,16 @@ ...@@ -179,9 +209,16 @@
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "拍照小工具", //模式名称
"path": "pages/photo/try", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}]
} }
} }
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
console.log(res,"品牌") console.log(res,"品牌")
} }
) )
this.$u.cloudApi.getstandard({brand_code:"B0001"}).then(res =>{ this.$u.cloudApi.getGroupStandard({product_code:"P0001",brand_code:"B0001"}).then(res =>{
console.log(res,"规范标准") console.log(res,"规范标准")
} }
) )
......
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">选择产品</text> <text class="topTitle"> {{product}} > 选择品牌</text>
<view class=""> <view class="u-p-b-48">
<view class="itemView u-m-t-80" v-for="(item,ikey) in brandList":key="ikey"> <view class="itemView u-m-t-48" @click="itemClick(item)" v-for="(item,ikey) in brandList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.title}}</text> <text class="itemTitle">{{item.name}}</text>
</view> </view>
</view> </view>
...@@ -14,31 +14,61 @@ ...@@ -14,31 +14,61 @@
export default { export default {
data() { data() {
return { return {
brandList:[] product_code:'',
brandList:[],
brand_code:'',
product:'',
brand:'',
} }
}, },
onLoad(e) { onLoad(e) {
if(e && e.product_code){
this.product_code = e.product_code
}
if(e && e.product){
this.product = e.product
}
this.getBrandList() this.getBrandList()
}, },
methods: { methods: {
getBrandList: function () { getBrandList: function () {
this.brandList = [
{ let that = this
'title':'广汽',
'id':0 this.$u.cloudApi.getBrand({product_code:this.product_code}).then(res =>{
}, console.log('获取品牌数据:')
{ console.log(res)
'title':'比亚迪',
'id':1 if(res.result.data){
that.brandList = res.result.data
}
} }
] )
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function (item) {
if(item.product_code){
this.brand_code = item.code
}
if(item.name){
this.brand = item.name
}
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/list' url:'/pages/photo/list'
+ '?brand_code=' + this.brand_code
+ '&brand=' + this.brand
+ '&product_code=' + this.product_code
+ '&product=' + this.product,
}) })
}, },
...@@ -62,21 +92,27 @@ ...@@ -62,21 +92,27 @@
} }
.topTitle{ .topTitle{
margin-top: 80rpx; margin-top: 192rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.itemView{ .itemView{
background-color: #999999; background-color: #FFFFFF;
width: 400rpx; width: 548rpx;
height: 80rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
} }
.itemTitle{ .itemTitle{
font-size: 28rpx; font-size: 32rpx;
font-weight:bold;
} }
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<view class="topView"> <view class="topView">
<text class="topTitle">示范照片 ({{currentNumber}}/{{totalNumber}})</text> <!--text class="topTitle">示范照片 ({{currentNumber}}/{{totalNumber}})</text-->
</view> </view>
<scroll-view scroll-x class="centerBackView"> <view class="wrap">
<image class="photoImage" @click="imageClick(item.image)" :src="item.image" mode="" v-for="(item,ikey) in photoList":key="ikey"></image> <u-swiper
</scroll-view> @click="imageClick"
<view class="bottomView"> @change="changeSwipter"
<view class="takeView" @click="takeClick"> img-mode="aspectFill"
<text class="takeText">按规范\n拍照</text> bg-color="#333333"
:height="600" :list="swiperList"
:autoplay="false"
:circular='false'
mode="dot"
:current="done_count"
></u-swiper>
</view> </view>
<view class="bottomView">
<image class="takeView" :src="icon_gotake" mode="" @click="takeClick"></image>
<image class="backIcon" :src="icon_arrow_down" mode="" @click="backClick"></image>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import uSwiper from '@/uview-ui/components/u-swiper/u-swiper'
export default { export default {
components:{
uSwiper
},
data() { data() {
return { return {
totalNumber:0, // background: ['color1', 'color2', 'color3'],
currentNumber:1, // indicatorDots: true,
photoList:[] // autoplay: true,
// interval: 2000,
// duration: 500,
image_count:1,
current_count:1,
current_image:'',
done_count:0,
images:[],
icon_gotake:'https://qn-static.banshouhui.com/gotake.png',
icon_arrow_down:'https://qn-static.banshouhui.com/arrow_down.png',
ifFirst:true,
last_done_count:0,
swiperList:[],
windowHeight:0,
title:''
}
},
watch:{
images(val){
let list = val.map(img=>{
return {
image:img
}
})
this.swiperList = list
// console.log(this.swiperList,'this.swiperList')
} }
}, },
computed:{
// swiperList(){
// console.log(this.images,'this.images')
// let list = this.images.map(img=>{
// return {
// image:img
// }
// })
// return list
// }
},
onLoad(e) { onLoad(e) {
this.initData() this.initData(e)
}, },
methods: {
initData: function () { onShow(){
if(this.isFirst == false){
this.checkDoneCount()
}
this.photoList = [
{
image:'https://qn-static.banshouhui.com/selected.png',
}, },
{ methods: {
image:'https://qn-static.banshouhui.com/close_new.png',
initData: function (e) {
if(e && e.current_image){
this.current_image = e.current_image
}
if(e && e.image_count){
this.image_count = e.image_count
}
if(e && e.current_count){
this.current_count = e.current_count
}
if(e && e.images){
this.images = [].concat(JSON.parse(e.images))
}
if(e && e.title){
this.title = e.title
if(this.title.length>6){
this.title = this.title.substr(0,6) + '...'
}
}
uni.setNavigationBarTitle({
title: this.title + ' (' + this.current_count + '/'+ this.image_count + ')'
})
uni.setNavigationBarColor({
frontColor:'#FFFFFF',
backgroundColor:'#333333',
})
}, },
{
image:'https://qn-static.banshouhui.com/auth_notice_new.png', //检查已拍照数量
checkDoneCount: function (){
let pages = getCurrentPages();
let currPage = pages[pages.length-1];
this.done_count = currPage.data.done_count
console.log('是否清除:')
//console.log(currPage.data.isClean)
if (currPage.data.done_count == this.image_count){
console.log('已拍完 所有数量照片')
uni.showToast({
icon:'none',
title:'已拍完此项照片'
})
setTimeout(function() {
uni.navigateBack({
})
}, 2000);
}else{
if(this.done_count != this.last_done_count ){
console.log('没有拍完 所有数量照片')
this.last_done_count = this.done_count
this.current_count = currPage.data.done_count + 1
this.current_image = this.images[currPage.data.done_count]
console.log('没有拍完 所有数量照片 current_count:'+this.current_count)
console.log('没有拍完 所有数量照片 current_image:'+this.current_image)
uni.setNavigationBarTitle({
title: this.title + ' (' + this.current_count + '/'+ this.image_count + ')'
})
} }
]
this.totalNumber = this.photoList.length }
}, },
//照片预览 //照片预览
imageClick: function (image) { imageClick: function (index) {
let currentImg = this.images[index]
uni.previewImage({ uni.previewImage({
urls: [image] urls: [currentImg],
current:index
})
},
changeSwipter(index){
let txt = '走线照片 (' + (index + 1) + '/'+ this.image_count + ')'
uni.setNavigationBarTitle({
title: txt
}) })
}, },
//拍照 点击 //拍照 点击
takeClick: function () { takeClick: function () {
this.isFirst = false
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/try' url:'/pages/photo/try'
}) })
}, },
//返回 点击
backClick: function () {
uni.navigateBack({
})
},
} }
...@@ -65,6 +203,12 @@ ...@@ -65,6 +203,12 @@
</script> </script>
<style> <style>
.wrap {
width:100%;
height:calc(100vh - 600rpx);
background-color:#333;
/* padding:0 40rpx; */
}
.backView{ .backView{
background-color: #FAFAFA; background-color: #FAFAFA;
position: absolute; position: absolute;
...@@ -78,9 +222,9 @@ ...@@ -78,9 +222,9 @@
} }
.topView{ .topView{
background-color: #000000; background-color: #333333;
width: 100%; width: 100%;
height: 15%; height: 12%;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -93,35 +237,36 @@ ...@@ -93,35 +237,36 @@
} }
.centerBackView{ .centerBackView{
background-color: #007AFF; background-color: #333333;
height: 800rpx; height: 47.3%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.photoImage{ .photoImage{
background-color: #4CD964; background-color: #333333;
width: 750rpx; width: 750rpx;
height: 800rpx; height: 568rpx;
} }
.bottomView{ .bottomView{
background-color: #000000; background-color: #333333;
width: 100%; width: 100%;
height: 20%; height: 40.7%;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
flex-direction: column-reverse;
align-items: center; align-items: center;
justify-content: center;
} }
.takeView{ .takeView{
background-color: #FFFFFF; background-color: #FFFFFF;
width: 160rpx; width: 146rpx;
height: 160rpx; height: 102rpx;
border-radius: 80rpx; border-radius: 16rpx;
margin-bottom: 50rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -132,4 +277,14 @@ ...@@ -132,4 +277,14 @@
text-align: center; text-align: center;
} }
.backIcon{
background-color: #FFFFFF;
width: 54rpx;
height: 54rpx;
border-radius: 27rpx;
position: fixed;
left: 60rpx;
bottom: 50rpx;
}
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">{{topTitle}}</text> <view class="topView">
<view class="centerBackView"> <view :class="activeTop == ikey ? 'topItemView whiteBackColor' : 'topItemView FAbackColor' " @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList":key="ikey">
<view class="leftView"> <text class="topActiveItemTitle" v-if="activeTop == ikey">{{item.type}}</text>
<view class="leftItemView" @click="leftItemClick(item,ikey)" v-for="(item,ikey) in leftList":key="ikey"> <text class="topItemTitle" v-if="activeTop != ikey">{{item.type}}</text>
<text class="leftItemText">{{item.title}}</text>
</view> </view>
</view> </view>
<view class="rightView"> <view class="rightView">
<view class="rightItemView" @click="rightItemClick(item,ikey)" v-for="(item,ikey) in rightList":key="ikey"> <template
v-for="(item,ikey) in rightList"
>
<view :class="['rightItemView',item.clickable ? 'FAbackColor' : '']" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class=" item.images ? 'rightContentView width_50' : 'rightContentView width_100' "> <view :class=" item.images ? 'rightContentView width_50' : 'rightContentView width_100' ">
<text class="rightTitle u-m-t-30 u-m-l-30">{{item.title}} ({{item.photoNumber}}张)</text> <text :class=" item.clickable ? 'gray999Color rightTitle u-m-t-30 u-m-l-30' : 'rightTitle u-m-t-30 u-m-l-30' ">{{item.name}} ({{item.image_count}}张)</text>
<text class="rightContent u-m-t-30 u-m-l-30 u-p-b-30">{{item.content}}</text> <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text>
</view> </view>
<view class="rightImageView" v-if="item.images"> <view class="rightImageView" v-if="item.images">
<image class="rightImage" src="" mode=""></image> <image class="rightImage" :src="item.images[0]" mode=""></image>
</view>
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
</template> </template>
...@@ -26,61 +29,117 @@ ...@@ -26,61 +29,117 @@
export default { export default {
data() { data() {
return { return {
topList:[],
topTitle:'', topTitle:'',
activeTop:0,
leftList:[], leftList:[],
rightList:[], rightList:[],
product:'',
product_code:'',
brand:'',
brand_code:'',
dataList:[],
} }
}, },
onLoad(e) { onLoad(e) {
this.topTitle = '充电桩-北汽'
this.getLeftData()
},
methods: {
getLeftData: function (){ if(e && e.product){
this.leftList = [ this.product = e.product
{'title':'回单','id':0}, }
{'title':'回单','id':1},
{'title':'回单','id':2} if(e && e.product_code){
] this.product_code = e.product_code
}
if(e && e.brand){
this.brand = e.brand
uni.setNavigationBarTitle({
title: this.brand
});
}
if(e && e.brand_code){
this.brand_code = e.brand_code
}
this.topTitle = this.product + '-' + this.brand
this.getListData()
this.getRightData()
},
getRightData: function () {
this.rightList = [
{
'title':'电源点照片',
'photoNumber':4,
'content':'拍照要求:232拍照要求131拍照要求23拍照要求123拍照要求12',
'images':['asdasdasd.png','assdasdad.png','asdsds.png']
},
{
'title':'电源点照片',
'photoNumber':4,
'content':'拍照要求:232拍照要求131拍照要求23拍照要求123拍照要求12',
'images':null
}, },
{
'title':'电源点照片', onShow() {
'photoNumber':4, console.log('onShow 里的rightList:')
'content':'拍照要求:232拍照要求131拍照要求23拍照要求123拍照要求12', console.log(this.rightList)
'images':['asdasdasd.png','assdasdad.png','asdsds.png']
}, },
]
methods: {
getListData: function (){
console.log('getListData:')
console.log('product_code' + this.product_code)
console.log('brand_code' + this.brand_code)
let that = this
this.$u.cloudApi.getGroupStandard({product_code:this.product_code,brand_code:this.brand_code}).then(res =>{
console.log('获取规范标准数据:')
console.log(res)
if(res.result && res.result.length){
that.handleData(res)
}
})
}, },
//左侧点击 handleData: function (res){
leftItemClick: function (item,ikey) {
this.getRightData() this.dataList = res.result
this.dataList.forEach(item => {
item.list.forEach(subItem => {
subItem.isClicked = false
})
})
console.log('添加 新字段 后的数组:')
console.log(this.dataList)
var item = res.result[0]
this.rightList = item.list
}, },
//顶部点击
topItemClick: function (ikey,item) {
this.activeTop = ikey
this.rightList = item.list
},
//右侧点击 //右侧点击
rightItemClick: function (item,ikey) { rightItemClick: function (item,ikey) {
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
this.$set(this.rightList[ikey],'clickable',true)
var current_image = item.images[0]
var current_count = 1
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/detail' url:'/pages/photo/detail'
+'?current_image=' + current_image
+'&image_count=' + item.image_count
+'&current_count=' + current_count
+'&images=' + JSON.stringify(item.images)
+'&title=' + item.name,
}) })
}, },
...@@ -136,7 +195,7 @@ ...@@ -136,7 +195,7 @@
.rightView{ .rightView{
background-color: #FFFFFF; background-color: #FFFFFF;
width: 80%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
...@@ -145,6 +204,7 @@ ...@@ -145,6 +204,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between;
border-bottom: 20rpx solid #F3F3F3; border-bottom: 20rpx solid #F3F3F3;
} }
...@@ -154,8 +214,16 @@ ...@@ -154,8 +214,16 @@
border-left: 2rpx solid #F3F3F3; border-left: 2rpx solid #F3F3F3;
} }
.rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{ .width_50{
width: 50%; width: 480rpx;
} }
.width_100{ .width_100{
...@@ -163,17 +231,19 @@ ...@@ -163,17 +231,19 @@
} }
.rightTitle{ .rightTitle{
font-size: 28rpx; font-size: 32rpx;
color: #4D87EA;
} }
.rightContent{ .rightContent{
font-size: 28rpx; font-size: 28rpx;
color: #333333;
line-height: 40rpx;
} }
.rightImageView{ .rightImageView{
background-color: #FFFFFF; width: 300rpx;
width: 50%; height: 320rpx;
height: 240rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -181,11 +251,57 @@ ...@@ -181,11 +251,57 @@
.rightImage{ .rightImage{
background-color: #F3F3F3; background-color: #F3F3F3;
width: 80%; width: 240rpx;
height: 80%; height: 240rpx;
} }
.topView{
background-color: #FAFAFA;
width: 100%;
height: 96rpx;
display: flex;
flex-direction: row;
}
.topItemView{
width: 210rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
}
.whiteBackColor{
background-color: #FFFFFF;
}
.FAbackColor{
background-color: #FAFAFA;
}
.topItemTitle{
font-size: 32rpx;
color: #999999;
padding-left: 30rpx;
}
.topActiveItemTitle{
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding-left: 30rpx;
}
.greenBackColor{
background-color: #4CD964;
}
.gray999Color{
color: #999999;
}
......
<template> <template>
<view>
<image class="pic" :src="images[0]" mode="aspectFill" @click="showPreviewFn"></image>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
protocolContent:'' protocolContent:'',
images:[]
} }
}, },
onLoad(e) { onLoad(e) {
console.log(e,'e')
if(e.img){
this.images = [e.img]
}
console.log(this.images,'this.images')
}, },
methods: { methods: {
showPreviewFn(img) {
uni.previewImage({
current: 0,
urls: this.images
});
},
//拨打客服 点击 //拨打客服 点击
phoneCallClick: function (phone) { phoneCallClick: function (phone) {
uni.makePhoneCall({ uni.makePhoneCall({
...@@ -28,4 +41,9 @@ ...@@ -28,4 +41,9 @@
</script> </script>
<style> <style>
.pic{
display: block;
width:100%;
height:auto;
}
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">选择产品</text> <text class="topTitle">选择产品</text>
<view class=""> <view class="u-p-b-48">
<view class="itemView u-m-t-80" v-for="(item,ikey) in productList":key="ikey"> <view class="itemView u-m-t-48" @click="itemClick(item)" v-for="(item,ikey) in productList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.title}}</text> <text class="itemTitle">{{item.name}}</text>
</view> </view>
</view> </view>
...@@ -14,31 +14,60 @@ ...@@ -14,31 +14,60 @@
export default { export default {
data() { data() {
return { return {
productList:[] productList:[],
product_code:'',
product:'',
} }
}, },
onLoad(e) { onLoad(e) {
this.getProductList() this.getProductList()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success(){},
fail(){}
}
return shareObj
}, },
methods: { methods: {
getProductList: function(){ getProductList: function(){
this.productList = [
{ let that = this
'title':'新风机',
'id':0 this.$u.cloudApi.getAllProduct().then(res =>{
}, console.log('获取产品数据:')
{ console.log(res)
'title':'充电桩', if(res.result && res.result.data){
'id':1 that.productList = res.result.data
} }
]
})
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function (item) {
if(item.code){
this.product_code = item.code
}
if(item.name){
this.product = item.name
}
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/brand' url:'/pages/photo/brand'
+ '?product_code=' + this.product_code
+ '&product=' + this.product,
}) })
}, },
...@@ -62,22 +91,26 @@ ...@@ -62,22 +91,26 @@
} }
.topTitle{ .topTitle{
margin-top: 80rpx; margin-top: 192rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.itemView{ .itemView{
background-color: #999999; background-color: #FFFFFF;
width: 400rpx; width: 548rpx;
height: 80rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
} }
.itemTitle{ .itemTitle{
font-size: 28rpx; font-size: 32rpx;
font-weight:bold;
} }
</style> </style>
This diff is collapsed.
This diff is collapsed.
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.14.1",
"appid": "wxd1d6eede324b0465",
"projectname": "miniprogram-1",
"cloudfunctionTemplateRoot": "",
"watchOptions": {
"ignore": []
},
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment