蒋俊杰 4 years ago
parent 6d683d39d8
commit 9db774bc03

@ -110,7 +110,7 @@
url: "/pages/goodsDetail/goodsDetail?id=" + id
})
}
},
}
}
</script>

@ -0,0 +1,43 @@
<template>
<view>
<camera device-position="back" mode="scanCode" flash="off" @error="error" @scancode='scancode' style="width: 100%; height: 500px;">
<!-- <cover-image class='cover-corner cover-left-top' src='/images/left-top.png'></cover-image>
<cover-image class='cover-corner cover-right-top' src='/images/right-top.png'></cover-image>
<cover-image class='cover-corner cover-left-bottom' src='/images/left-bottom.png'></cover-image>
<cover-image class='cover-corner cover-right-bottom' src='/images/right-bottom.png'></cover-image> -->
<!-- <cover-view class="">
<cover-view>图片</cover-view>
<cover-view>......</cover-view>
</cover-view> -->
</camera>
<view>
<view>图片</view>
<view>手动输入</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
src:""
}
},
methods: {
scancode(e){
//
let res = e.detail.result
console.log(e)
},
error(e) {
console.log(e.detail);
}
}
}
</script>
<style lang="scss">
</style>

@ -0,0 +1,100 @@
<template>
<view class="content">
<view class="resultBox">
<view class="result">暂未录入改商品</view>
<view class="text">
扫码结果
{{code}}
</view>
</view>
<view class="buttonBox">
<button class="redBtn" @click="scan"></button>
<button class="whiteBtn" @click="backHome"></button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: ''
}
},
onLoad(option) {
console.log(option)
if (option.code) {
this.code = option.code
}
},
methods: {
scan() {
let that = this
uni.scanCode({
success: function(res) {
console.log(res)
let code = res.result
that.$u.post('/api/v1/goods/code/search', {code: code}).then(res => {
console.log(res)
if (res.code === 'FAIL') {
return
}
if (res.data.code === 'FAIL') {
uni.reLaunch({
url: "/packageA/scan/scanFail?code=" + code
})
}
uni.navigateTo({
url: "/pages/goodsDetail/goodsDetail?id=" + res.data.data.goodsId
})
});
}
});
},
backHome() {
console.log(12432)
uni.reLaunch({
url: '../../pages/index/index'
})
}
}
}
</script>
<style>
page{
background:#FFFFFF;
}
</style>
<style lang="scss">
.content{
.resultBox{
padding: 40px;
.result{
font-size: 48rpx;
margin-bottom: 15px;
}
.text{
font-size: 42rpx;
border-bottom: 1px solid rgba(0,0,0,0.35);
}
}
.buttonBox{
margin-top: 50px;
.redBtn{
width: 80%;
background: red;
color: white;
margin-bottom: 15px;
}
.whiteBtn{
width: 80%;
color: red;
background: #FFFFFF;
border: 1px solid red;
}
}
}
</style>

@ -549,6 +549,21 @@
"enablePullDownRefresh": false
}
},
//
{
"path": "scan/scanFail",
"style": {
"navigationBarTitleText": "识别失败",
"enablePullDownRefresh": false
}
},
{
"path": "scan/scan",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "invoiceTitle/invoiceTitle",
"style": {

@ -68,20 +68,25 @@
}
},
onShareAppMessage(res) {
let pages = getCurrentPages() //
let currentPage = pages[pages.length - 1] //
let url = currentPage.route // url
let shareObj = {
title: "",
path: url + "?invite=" + this.$store.state.invitationNo,
imageUrl: ''
}
console.log(res)
// let goodsMsg = res.target.dataset.goods
if (res.from === 'button') { //
console.log(res.target)
}
return res.from === 'button' ? {
title: "我在看" + res.target.dataset.goods.name + ",快来加入吧!",
path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.goods.id + "&type=share",
imageUrl: this.IMAGE_URL + res.target.dataset.goods.mainPhotoURL
} : {
title: '阿库网络公司正在邀请您加入瑞库客0成本带您玩转副业',
path: '/pages/mobileLogin/mobileLogin?invitationNo=' + this.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
shareObj = {
title: "我在看" + res.target.dataset.goods.name + ",快来加入吧!",
path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.goods.id + "&type=share&invite=" + this.$store.state.invitationNo,
imageUrl: this.IMAGE_URL + res.target.dataset.goods.mainPhotoURL
}
}
console.log(shareObj)
return shareObj
}
}
</script>

@ -896,20 +896,23 @@
}
if (res.from === 'button') { //
console.log(this.$store.state.invitationNo)
shareObj = {
title: "阿库网络公司正在邀请您加入瑞库客0成本带您玩转副业",
path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
if (this.roleLevel == 500) {
shareObj = {
title: uni.getStorageSync('userInfo').nickname+"正在邀请您加入瑞库客0成本带您玩转副业",
path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
}
}
} else {
if (!this.isLogin) {
shareObj = {
title: "阿库网络公司正在邀请您加入瑞库客0成本带您玩转副业",
path: '/pages/index/index',
path: '/pages/index/index?invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
}
}
}
console.log(shareObj)
return shareObj
}
}

@ -4,9 +4,9 @@
<!-- 背景随轮播图模糊变色 -->
<view class="blur-bg">
<view class="blur-bg-con" :style="'background-image: url('+bgImage+');'"></view>
</view>
</view>
<!-- 搜索框 u-sticky为吸顶 -->
<!-- <u-sticky bg-color="transparent" @fixed="changebg" @unfixed="hidebg"> -->
<view class="search-box flex justify-between text-white" :class="showBg?'search-bg':'hide-bg'">
<view class="flex location text-hidden" @tap="toLocation">
@ -242,19 +242,21 @@
this.getWeather()
}
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res.target.dataset)
}
return {
title: '阿库网络公司正在邀请您加入瑞库客0成本带您玩转副业',
path: '/pages/index/index',
imageUrl: this.STATIC_URL + 'invite.jpg'
}
},
onLoad() {
// uni.getStorageSync("userInfo").id
let pages = getCurrentPages() //
let currentPage = pages[pages.length - 1] //
let url = currentPage.route // url
let options = currentPage.options // urloptions
console.log(options)
if(options.invite){
console.log(options)
this.$store.commit('setinvite', options.invite);
}
if (uni.getStorageSync("localCity")) {
//
this.currentCity = this.cityName = uni.getStorageSync("localCity")
@ -513,15 +515,40 @@
let M = timestr.split(" ")[1].split(":")[1]
return H + ":" + M
},
//
scan() {
let that = this
uni.scanCode({
success: function(res) {
// console.log('' + res.scanType);
// console.log('' + res.result);
console.log(res)
let code = res.result
that.$u.post('/api/v1/goods/code/search', {code: code}).then(res => {
console.log(res)
if (res.code === 'FAIL') {
return
}
if (res.data.code === 'FAIL') {
uni.reLaunch({
url: "/packageA/scan/scanFail?code=" + code
})
}
uni.navigateTo({
url: "/pages/goodsDetail/goodsDetail?id=" + res.data.data.goodsId
})
});
}
});
},
// scan() {
// console.log('1234')
// uni.navigateTo({
// url: '/pages/scan/scan'
// })
// },
toDeitail(id,src){
if(src !== ''){
let data = {
@ -614,7 +641,34 @@
},
onPullDownRefresh() {
this.getGoodsList()
}
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: "/pages/index/index?invite=" + this.$store.state.invitationNo,
imageUrl: ''
}
if (res.from === 'button') { //
console.log(res)
if (res.target.dataset.title) {
shareObj = {
title: "我在买" + res.target.dataset.title + ",快来看看吧!",
path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.id + "&type=share&invite=" + this.$store.state.invitationNo,
imageUrl: this.IMAGE_URL + res.target.dataset.url
}
} else {
shareObj = {
title: uni.getStorageSync("userInfo").nickname + '正在邀请您加入瑞库客0成本带您玩转副业',
path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
}
}
} else {
}
console.log(shareObj)
return shareObj
},
}
</script>

@ -96,12 +96,12 @@
if (that.$store.state.url) {
let url = that.$store.state.url
console.log(url)
uni.navigateTo({
uni.reLaunch({
url: url
})
that.$store.commit('removeUrl')
} else {
uni.reLaunch({
uni.navigateTo({
url:"../index/index"
})
}

@ -33,7 +33,7 @@
time:60,
showTime:false,
timer:null,
invitationNo:"000000",
invitationNo:"NXR0L3",
wxUnionId:null
};
},

@ -171,7 +171,29 @@
this.goodsList.push(...goodsList)
});
}
}
},
onShareAppMessage(res) {
let pages = getCurrentPages() //
let currentPage = pages[pages.length - 1] //
let url = currentPage.route // url
let shareObj = {
title: "",
path: url + "?invite=" + this.$store.state.invitationNo,
imageUrl: ''
}
if (res.from === 'button') { //
console.log(res)
if (res.target.dataset.title) {
shareObj = {
title: "我在买" + res.target.dataset.title + ",快来看看吧!",
path: '/pages/goodsDetail/goodsDetail?id=' + res.target.dataset.id + "&type=share&invite=" + this.$store.state.invitationNo,
imageUrl: this.IMAGE_URL + res.target.dataset.url
}
}
}
console.log(shareObj)
return shareObj
},
}
</script>

@ -482,14 +482,16 @@
}
},
onShareAppMessage(res) {
if (res.from === 'button') { //
console.log(res.target)
}
return {
title: '阿库网络公司正在邀请您加入瑞库客0成本带您玩转副业',
let shareObj = {
title: uni.getStorageSync('userInfo').nickname+'正在邀请您加入瑞库客0成本带您玩转副业',
path: '/pages/login/login?type=share&invite=' + this.$store.state.invitationNo,
imageUrl: this.STATIC_URL + 'invite.jpg'
}
if (res.from === 'button') { //
console.log(res.target)
}
console.log(shareObj)
return shareObj
}
}
</script>

Loading…
Cancel
Save