作者 rico

完善更多内容

... ... @@ -12,12 +12,15 @@
<block v-if="current === 0">
<!-- 地址 -->
<view class="home">
<view @click="toadd" class="home">
<image src="../../../static/address.png"></image>
<view>
<text>1111 444444</text>
<text>2222</text>
<text>3333</text>
<text v-if="user_address_id === ''">点击选择地址</text>
<block v-else>
<text >{{user_address.consignee}} {{user_address.phone}}</text>
<text>{{user_address.province_name + user_address.city_name + user_address.area_name + user_address.address}}</text>
</block>
</view>
</view>
... ... @@ -29,10 +32,14 @@
<!-- 设备详情 -->
<view class="xiangxi">
<image src="../../../static/background.png" mode=""></image>
<text>11111111111111111111111111111111111111111111111</text>
<image :src="equipment.quipment_image" mode=""></image>
<text>{{equipment.equipment_name}}</text>
</view>
<view class="bottom-wrp">
<text @click="callPhone">联系电话: {{number || '扫描后机器后获得'}}</text>
<view @click="serive">维修</view>
</view>
<view @click="saoma">扫码</view>
</block>
<block v-else>
... ... @@ -66,17 +73,87 @@
return {
list:['预约安装','历史工单'],
current:0,
his:''
his:'',
equipment_id:'',
user_address_id:'',
user_address:'',
address: {
is_default: 0
},
equipment:'',
page:1
};
},
onReachBottom(){
if(this.current === 1){
const data = {
page:this.page + 1
}
this.page = this.page + 1
request.post('api/aftersale/installList',data).then(r=>{
if(r.code == 1){
let a = r.data.data
a = this.his.concat(a)
this.his = a
}
})
}
},
watch:{
address(val, oldVal) {
console.log(val)
this.user_address = val
this.user_address_id = val.id
const data = {
equipment_id: this.equipment_id,
user_address_id : this.user_address_id
}
request.post('api/aftersale/installView',data).then(r=>{
if(r.code === 1){
this.equipment = r.data.equipment
}
})
}
},
methods:{
saoma(){
this.$wxsdk.scanQRCode(res => {
console.log('1')
console.log(res)
console.log('2')
});
toadd(){
uni.navigateTo({
url:'/pages/user/address/list'
})
},
serive(){
const data = {
equipment_id:this.equipment_id,
user_address_id:this.user_address_id
}
if(this.equipment_id !== '' && this.user_address_id !== ''){
request.post('api/aftersale/repair',data,'POST').then(r=>{
uni.showToast({
title:r.msg,
icon:'none'
})
})
}else{
uni.showToast({
title:'内容不能为空 请重试',
icon:'none',
success() {
setTimeout(()=>{
uni.reLaunch({
url:'/pages/index/view?id=13'
})
},500)
}
})
}
},
callPhone(){
uni.makePhoneCall({
phoneNumber:this.number
})
},
toMsg(e){
uni.navigateTo({
... ... @@ -85,13 +162,7 @@
},
changeIndex(e){
this.current = parseInt(e.currentTarget.dataset.index)
if(this.current === 0){
request.post('api/aftersale/installList').then(r=>{
if(r.code == 1){
}
})
}else if(this.current === 1){
if(this.current === 1){
request.post('api/aftersale/installList').then(r=>{
if(r.code == 1){
this.his = r.data.data
... ... @@ -100,20 +171,37 @@
}
}
},
onLoad:function(option){
// const data = {
// lower_user_id : option.id
// }
// request.post('api/aftersale/installView',data).then(r=>{
// if(r.code == 1){
// console.log(r)
// }
// })
onLoad:function(){
this.$wxsdk.scanQRCode(res => {
this.equipment_id = res.resultStr
});
},
}
</script>
<style lang="scss" scoped>
.bottom-wrp{
width: 686rpx;
text-align: center;
position: absolute;
bottom: 64rpx;
// top:50%;
left:50%;
transform:translate(-50%, -50%);
>text{
color: #576B95;
text-decoration: underline;
font-size: 24rpx;
}
>view{
margin-top: 32rpx;
background: linear-gradient(135deg,#08a3e3, #0ac6d2);
border-radius: 16rpx;
color: white;
padding-top: 24rpx;
padding-bottom: 24rpx;
}
}
.all{
display: flex;
justify-content: space-around;
... ...
... ... @@ -12,7 +12,7 @@
<block v-if="current === 0">
<!-- 地址 -->
<view class="home">
<view @click="toadd" class="home">
<image src="../../../static/address.png"></image>
<view>
<text>{{user_address.consignee}} {{user_address.phone}}</text>
... ... @@ -30,7 +30,7 @@
<view class="xiangxi">
<text>产品类型</text>
<view>
<picker range-key="name" :value=0 mode="selector" :range="listSelect" @change="change">
<picker range-key="name" mode="selector" :range="listSelect" @change="change">
<view>{{value_ || '请选择'}}</view>
</picker>
<image src="../../../static/back.png" mode=""></image>
... ... @@ -66,10 +66,10 @@
<radio-group @change="getPay">
<label class="lable">
<radio value="1" /><view class="equipment">上门支付</view>
<radio class="radio" value="1" /><view class="equipment">上门支付</view>
</label>
<label class="lable">
<radio value="2" /><view class="equipment">立即支付</view>
<radio class="radio" value="2" /><view class="equipment">立即支付</view>
</label>
</radio-group>
... ... @@ -79,7 +79,7 @@
<view @click="afterServe">维护</view>
</view>
</block>
<block v-else>
<view @click="toMsg(item.id)" class="No-" v-for="(item,index) in his">
<view class="msg-wrp">
... ... @@ -110,7 +110,7 @@
list:['预约维修','历史工单'],
current:0,
list2:'',
listSelect:['dnkmsqjodjioqw','fjiwjio'],
listSelect:['加载中','加载中'],
value_:'',
user_address:'',
care_package_list:'',
... ... @@ -120,9 +120,20 @@
care_package_id:'',
category_id:'',
his:'',
page:1
page:1,
address: {
is_default: 0
}
};
},
watch:{
address(val, oldVal) {
console.log(val)
this.user_address = val
this.user_address_id = val.id
console.log(val.id)
}
},
onReachBottom(){
if(this.current === 1){
const data = {
... ... @@ -143,7 +154,8 @@
this.care_package_id = e.detail.value
},
getPay(e){
this.paytype = e.detail.value
let a = Number(e.detail.value)
this.paytype = a
},
afterServe(){
const data = {
... ... @@ -154,7 +166,7 @@
}
if(this.category_id !== '' && this.care_package_id !== '' && this.user_address_id !== '' && this.paytype !== ''){
request.post('api/aftersale/care',data,'GET').then(r=>{
if(r.code == 1){
if(r.code === 1){
if(this.paytype === '2'){
uni.showToast({
title:'发起支付中',
... ... @@ -190,8 +202,14 @@
})
},
change(e){
this.value_ = this.listSelect[e.detail.value].name
this.category_id = this.listSelect[e.detail.value].id
let a = Number(e.detail.value)
this.value_ = this.listSelect[a].name
this.category_id = this.listSelect[a].id
},
toadd(){
uni.navigateTo({
url:'/pages/user/address/list'
})
},
toMsg(e){
uni.setStorageSync('toType',3)
... ... @@ -221,9 +239,6 @@
}
},
onLoad:function(option){
const data = {
user_address_id : option.id
}
request.post('api/aftersale/careView').then(r=>{
if(r.code === 1){
this.user_address = r.data.user_address
... ... @@ -233,7 +248,6 @@
this.user_address_id = r.data.user_address.id
}
})
this.init();
},
}
</script>
... ... @@ -245,10 +259,9 @@
align-items: center;
margin: 0 auto;
margin-left: 32rpx;
// radio{
// width: 32rpx;
// height: 32rpx;
// }
.radio{
transform: scale(0.6);
}
}
.dol::before{
content: '¥';
... ...
... ... @@ -12,7 +12,7 @@
<block v-if="current === 0">
<!-- 地址 -->
<view class="home">
<view @click="toadd" class="home">
<image src="../../../static/address.png"></image>
<view>
<text>{{user_address.consignee}} {{user_address.phone}}</text>
... ... @@ -48,7 +48,7 @@
<view v-if="his.length === 0">
暂无维修记录~
</view>
<view @click="toMsg(item.id)" class="No-" v-for="(item,index) in his">
<view @click="toMsg(item.id)" class="No-" v-for="(item,index) in his">
<!-- <image src="../../../static/imgs/kefu/sys_head.png" mode=""></image> -->
<view class="msg-wrp">
<text>{{item.consignee}} {{item.phone}}</text>
... ... @@ -83,9 +83,20 @@
category_id:'',
user_address_id:'',
his:'',
page:1
page:1,
address: {
is_default: 0
}
};
},
watch:{
address(val, oldVal) {
console.log(val)
this.user_address = val
this.user_address_id = val.id
console.log(val.id)
}
},
onReachBottom(){
if(this.current === 1){
const data = {
... ... @@ -102,6 +113,17 @@
}
},
methods:{
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
},
toadd(){
uni.navigateTo({
url:'/pages/user/address/list'
})
},
callPhone(){
uni.makePhoneCall({
phoneNumber:this.number
... ... @@ -120,7 +142,6 @@
})
})
}else{
console.log(data)
uni.showToast({
title:'请先补全信息',
icon:'none'
... ... @@ -143,7 +164,6 @@
if(this.current === 0){
request.post('api/aftersale/installList').then(r=>{
if(r.code == 1){
console.log(r)
this.list2 = r.data.data
}
})
... ... @@ -151,19 +171,14 @@
request.post('api/aftersale/repairList').then(r=>{
if(r.code == 1){
this.his = r.data.data
console.log(r)
}
})
}
}
},
onLoad:function(option){
const data = {
user_address_id : option.id
}
request.post('api/aftersale/repairView').then(r=>{
if(r.code === 1){
console.log(r)
this.number = r.time
this.user_address = r.data.user_address
this.listSelect = r.data.category_list
... ...
... ... @@ -21,6 +21,7 @@
<shopro-tabbar></shopro-tabbar>
<!-- 登录提示 -->
<shopro-login-modal></shopro-login-modal>
</view>
</template>
... ... @@ -100,6 +101,18 @@ export default {
}
},
onLoad(option) {
uni.getStorage({
key:'token',
fail() {
uni.showToast({
title:'请先登录',
icon:'none'
})
uni.reLaunch({
url:'/pages/index/user'
})
}
})
this.viewId = this.$Route.query.id;
},
onShow() {
... ...
<template>
<view class="container">
<!-- 背景图 -->
<view class="x-c"><image class="logo-bg" src="http://shopro.7wpp.com/imgs/logo_bg.png" mode=""></image></view>
<view class="x-c">
<image class="logo-bg" src="http://shopro.7wpp.com/imgs/logo_bg.png" mode=""></image>
</view>
<!-- titleview -->
<view class="head-box"><cu-custom :isBack="true"></cu-custom></view>
<view class="head-box">
<cu-custom :isBack="true"></cu-custom>
</view>
<view class="wrapper">
<!-- logo -->
<view class="x-c"><image class="logo" :src="sysInfo.logo" mode="widthFix"></image></view>
<!-- 登录tab -->
<view class="tab-box x-f">
<view class="tab-item x-c" @tap="onLoginWay(0)">
<text class="tab-title">手机登录</text>
<view class="line-box" v-show="loginWay === 0"><text class="triangle"></text></view>
</view>
<view class="tab-item x-c" @tap="onLoginWay(1)">
<text class="tab-title">密码登录</text>
<view class="line-box" password v-show="loginWay === 1"><text class="triangle"></text></view>
</view>
</view>
<!-- 表单 -->
<view class="login-box y-f" v-show="loginWay === 0">
<view class="input-item x-c"><input class="inp" v-model="userPhone" type="number" placeholder="请输入手机号" placeholder-class="pl" /></view>
<view class="input-item x-c">
<input class="inp" v-model="code.value" type="number" placeholder="请输入验证码" placeholder-class="pl" />
<button class="cu-btn code-btn" :disabled="code.status" @tap="getCode">{{ code.text }}</button>
</view>
</view>
<view class="login-box y-f" v-show="loginWay === 1">
<view class="input-item x-c"><input class="inp" v-model="userPhone" type="number" placeholder="请输入账号" placeholder-class="pl" /></view>
<view class="input-item x-c"><input class="inp" password v-model="userPassword" type="text" placeholder="请输入密码" placeholder-class="pl" /></view>
</view>
<!-- 登录按钮 -->
<view class="x-c y-f">
<button class="cu-btn login-btn mb30" @tap="toLogin">登录</button>
<view class="x-bc tip-box ">
<button class="cu-btn tip-btn" @tap="jump('/pages/public/register')">立即注册</button>
<view class="" v-show="loginWay === 1"><button class="cu-btn tip-btn" @tap="jump('/pages/public/forgot')">忘记密码</button></view>
</view>
<view class="x-c">
<image class="logo" :src="sysInfo.logo" mode="widthFix"></image>
</view>
<!-- 登录tab -->
<!-- -->
<view class="third-party y-f">
<!-- #ifdef H5 -->
<button class="cu-btn wx-logo-box y-f" @tap="wxLogin">
... ... @@ -63,261 +41,289 @@
</template>
<script>
import Wechat from '@/common/wechat/wechat';
import { mapMutations, mapActions, mapState } from 'vuex';
import store from '@/common/store';
export default {
data() {
return {
code: {
text: '获取验证码',
status: false,
value: ''
},
loginWay: 0,
userPhone: '',
userPassword: '',
sysInfo: uni.getStorageSync('sysInfo')
};
},
computed: {
...mapState({
initData: state => state.init.initData
})
},
onLoad() {
if (this.$Route.query.token) {
this.setTokenAndBack(this.$Route.query.token);
}
},
onShow() {},
methods: {
...mapActions(['getUserInfo', 'setTokenAndBack']),
// #ifdef MP-WEIXIN
async getuserinfo(e) {
var wechat = new Wechat();
let token = await wechat.wxMiniProgramLogin(e);
store.commit('FORCE_OAUTH', false);
this.setTokenAndBack(token);
import Wechat from '@/common/wechat/wechat';
import {
mapMutations,
mapActions,
mapState
} from 'vuex';
import store from '@/common/store';
export default {
data() {
return {
code: {
text: '获取验证码',
status: false,
value: ''
},
loginWay: 0,
userPhone: '',
userPassword: '',
sysInfo: uni.getStorageSync('sysInfo')
};
},
// #endif
async wxLogin() {
let wechat = new Wechat();
let token = await wechat.login();
if (token !== undefined) {
this.setTokenAndBack(token);
}
computed: {
...mapState({
initData: state => state.init.initData
})
},
onLoginWay(flag) {
this.loginWay = flag;
onLoad(e) {
if (this.$Route.query.token) {
this.setTokenAndBack(this.$Route.query.token);
}else{
console.log(e.user_id !== undefined)
if(e.user_id !== undefined){
}else{
uni.getStorage({
key:'share_id',
success:function(res){
uni.reLaunch({
url:'/pages/public/login?user_id='+res.data
})
console.log('运行结束')
}
})
}
}
},
toLogin() {
let that = this;
if (that.loginWay === 0) {
that.$api('user.mobileLogin', {
onShow() {},
methods: {
...mapActions(['getUserInfo', 'setTokenAndBack']),
// #ifdef MP-WEIXIN
async getuserinfo(e) {
var wechat = new Wechat();
let token = await wechat.wxMiniProgramLogin(e);
store.commit('FORCE_OAUTH', false);
this.setTokenAndBack(token);
},
// #endif
async wxLogin() {
let wechat = new Wechat();
let token = await wechat.login();
if (token !== undefined) {
this.setTokenAndBack(token);
}
console.log(token)
},
onLoginWay(flag) {
this.loginWay = flag;
},
toLogin() {
let that = this;
if (that.loginWay === 0) {
that.$api('user.mobileLogin', {
mobile: that.userPhone,
code: that.code.value
}).then(res => {
if (res.code === 1) {
that.setTokenAndBack(res.data.userinfo.token);
}
});
}
if (that.loginWay === 1) {
that.$api('user.accountLogin', {
account: that.userPhone,
password: that.userPassword
}).then(res => {
if (res.code === 1) {
that.setTokenAndBack(res.data.userinfo.token);
}
});
}
},
// 获取短信
async getCode() {
let that = this;
that.code.status = true;
let countdown = 60;
that.$api('sms.send', {
mobile: that.userPhone,
code: that.code.value
event: 'mobilelogin'
}).then(res => {
if (res.code === 1) {
that.setTokenAndBack(res.data.userinfo.token);
that.code.text = countdown + '秒';
that.code.status = true;
let timer = setInterval(() => {
if (countdown > 0) {
that.code.text = countdown - 1 + '秒';
countdown--;
} else {
clearInterval(timer);
that.code.text = '获取验证码';
that.code.status = false;
}
}, 1000);
} else {
that.code.status = false;
}
});
}
if (that.loginWay === 1) {
that.$api('user.accountLogin', {
account: that.userPhone,
password: that.userPassword
}).then(res => {
if (res.code === 1) {
that.setTokenAndBack(res.data.userinfo.token);
}
},
// 路由跳转
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
}
},
// 获取短信
async getCode() {
let that = this;
that.code.status = true;
let countdown = 60;
that.$api('sms.send', {
mobile: that.userPhone,
event: 'mobilelogin'
}).then(res => {
if (res.code === 1) {
that.code.text = countdown + '秒';
that.code.status = true;
let timer = setInterval(() => {
if (countdown > 0) {
that.code.text = countdown - 1 + '秒';
countdown--;
} else {
clearInterval(timer);
that.code.text = '获取验证码';
that.code.status = false;
}
}, 1000);
} else {
that.code.status = false;
}
});
},
// 路由跳转
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
}
}
};
};
</script>
<style lang="scss">
.container {
position: relative;
width: 100vw;
height: 100vh;
// overflow: hidden;
background: linear-gradient(180deg, rgba(239, 196, 128, 1) 0%, rgba(248, 220, 165, 1) 25%, rgba(255, 255, 255, 1) 98%);
.container {
position: relative;
width: 100vw;
height: 100vh;
// overflow: hidden;
background: linear-gradient(180deg, rgba(239, 196, 128, 1) 0%, rgba(248, 220, 165, 1) 25%, rgba(255, 255, 255, 1) 98%);
// titleview
.head-box {
.cuIcon-back {
font-size: 50rpx !important;
font-weight: 500;
// titleview
.head-box {
.cuIcon-back {
font-size: 50rpx !important;
font-weight: 500;
}
}
}
// logo
.logo {
width: 410rpx;
height: 120rpx;
}
// logo
.logo {
width: 410rpx;
height: 120rpx;
}
.logo-bg {
width: 640rpx;
height: 300rpx;
.logo-bg {
width: 640rpx;
height: 300rpx;
}
}
}
.wrapper {
position: absolute;
z-index: 90;
padding-bottom: 40upx;
padding-top: 115px;
width: 100vw;
height: 100vh;
top: 0;
.wrapper {
position: absolute;
z-index: 90;
padding-bottom: 40upx;
padding-top: 115px;
width: 100vw;
height: 100vh;
top: 0;
// 登录选项卡
.tab-box {
margin: 60rpx auto 30rpx;
width: 608rpx;
// 登录选项卡
// .tab-box {
// margin: 60rpx auto 30rpx;
// width: 608rpx;
.tab-item {
flex: 1;
height: 80rpx;
position: relative;
// .tab-item {
// flex: 1;
// height: 80rpx;
// position: relative;
.tab-title {
font-size: 32rpx;
font-weight: bold;
color: #845708;
}
// .tab-title {
// font-size: 32rpx;
// font-weight: bold;
// color: #845708;
// }
.line-box {
position: absolute;
width: 300rpx;
height: 4rpx;
background: rgba(233, 181, 98, 1);
bottom: 0;
left: 50%;
transform: translateX(-50%);
// .line-box {
// position: absolute;
// width: 300rpx;
// height: 4rpx;
// background: rgba(233, 181, 98, 1);
// bottom: 0;
// left: 50%;
// transform: translateX(-50%);
.triangle {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
disply: block;
width: 0;
height: 0;
border-width: 10rpx;
border-style: solid;
border-color: transparent transparent #e9b562 transparent;
}
}
}
}
// .triangle {
// position: absolute;
// bottom: 0;
// left: 50%;
// transform: translateX(-50%);
// disply: block;
// width: 0;
// height: 0;
// border-width: 10rpx;
// border-style: solid;
// border-color: transparent transparent #e9b562 transparent;
// }
// }
// }
// }
// 输入
.login-box {
.input-item {
height: 108rpx;
border-bottom: 1rpx solid rgba(#d0b17b, 0.3);
width: 608rpx;
// 输入
// .login-box {
// .input-item {
// height: 108rpx;
// border-bottom: 1rpx solid rgba(#d0b17b, 0.3);
// width: 608rpx;
.inp {
flex: 1;
height: 100%;
font-size: 28rpx;
}
// .inp {
// flex: 1;
// height: 100%;
// font-size: 28rpx;
// }
.pl {
color: #c8963d;
}
// .pl {
// color: #c8963d;
// }
.code-btn {
background: none;
font-size: 28rpx;
color: #845708;
}
}
}
// .code-btn {
// background: none;
// font-size: 28rpx;
// color: #845708;
// }
// }
// }
// 登录
.login-btn {
width: 630upx;
height: 80upx;
border-radius: 40rpx;
margin-top: 70upx;
background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
color: #fff;
}
// 登录
// .login-btn {
// width: 630upx;
// height: 80upx;
// border-radius: 40rpx;
// margin-top: 70upx;
// background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
// box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
// color: #fff;
// }
// .tip-box {
// width: 630rpx;
// .tip-btn {
// font-size: 26rpx;
// font-family: PingFang SC;
// font-weight: 400;
// text-decoration: underline;
// color: rgba(200, 150, 61, 1);
// background: none;
// }
// }
// 一键登录按钮
.wx-logo-box {
.tip-box {
width: 630rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
.tip-btn {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-decoration: underline;
color: rgba(200, 150, 61, 1);
margin-top: 80rpx;
background: none;
}
}
display: block;
// 一键登录按钮
.wx-logo-box {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(200, 150, 61, 1);
margin-top: 80rpx;
background: none;
display: block;
&:hover {
background: none;
}
.auto-login {
width: 80rpx;
height: 80rpx;
overflow: hidden;
margin-bottom: 10rpx;
&:hover {
background: none;
}
.auto-login {
width: 80rpx;
height: 80rpx;
overflow: hidden;
margin-bottom: 10rpx;
}
}
}
}
</style>
... ...