- 优化 productcard.vue 图片url取得是 array
- 订单url地址选择 未完成
This commit is contained in:
parent
f9e74ddacd
commit
6d3fe11b17
@ -18,14 +18,14 @@ export function DelFavorite(id){
|
|||||||
|
|
||||||
export function GetAddressList(){
|
export function GetAddressList(){
|
||||||
return request({
|
return request({
|
||||||
url: '/user-api/user/address/list',
|
url: '/user-api/users/address/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function GetAddressById(id){
|
export function GetAddressById(id){
|
||||||
return request({
|
return request({
|
||||||
url: '/user-api/user/address/address',
|
url: '/user-api/users/address/address',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id }
|
params: { id }
|
||||||
})
|
})
|
||||||
@ -33,7 +33,7 @@ export function GetAddressById(id){
|
|||||||
|
|
||||||
export function UpdateAddress(data){
|
export function UpdateAddress(data){
|
||||||
return request({
|
return request({
|
||||||
url: '/user-api/user/address/update',
|
url: '/user-api/users/address/update',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
@ -41,7 +41,7 @@ export function UpdateAddress(data){
|
|||||||
|
|
||||||
export function SaveAddress(data){
|
export function SaveAddress(data){
|
||||||
return request({
|
return request({
|
||||||
url: '/user-api/user/address/add',
|
url: '/user-api/users/address/add',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
@ -49,13 +49,12 @@ export function SaveAddress(data){
|
|||||||
|
|
||||||
export function DelAddress(data){
|
export function DelAddress(data){
|
||||||
return request({
|
return request({
|
||||||
url: '/user-api/user/address/remove',
|
url: '/user-api/users/address/remove',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function GetCoupon(data){
|
export function GetCoupon(data){
|
||||||
return request({
|
return request({
|
||||||
url: '/User/GetCoupon',
|
url: '/User/GetCoupon',
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
style="background:#fff"
|
style="background:#fff"
|
||||||
>
|
>
|
||||||
<template slot="thumb">
|
<template slot="thumb">
|
||||||
<img :src="product.picUrls[0]"/>
|
<img :src="product.picUrl"/>
|
||||||
<p v-if="product.imageTag!=null&&product.imageTag!=''" class="image_tag">{{product.imageTag}}</p>
|
<p v-if="product.imageTag!=null&&product.imageTag!=''" class="image_tag">{{product.imageTag}}</p>
|
||||||
</template>
|
</template>
|
||||||
<template slot="tags">
|
<template slot="tags">
|
||||||
|
@ -32,7 +32,7 @@ const serviceRouter = function(requestUrl) {
|
|||||||
const configProd = {
|
const configProd = {
|
||||||
'/order-api': {
|
'/order-api': {
|
||||||
prefix: '/order-api',
|
prefix: '/order-api',
|
||||||
target: 'http://api.shop.iocoder.cn:18099/order-api',
|
target: 'http://api.shop.iocoder.cn:18088/order-api',
|
||||||
},
|
},
|
||||||
'/user-api': {
|
'/user-api': {
|
||||||
prefix: '/user-api',
|
prefix: '/user-api',
|
||||||
|
6
mobile-web/src/page/eventBus.js
Normal file
6
mobile-web/src/page/eventBus.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义空的vue实例,作为 eventbus实现非父子组件之间的通信(vue2.x中去掉了broadcast)
|
||||||
|
*/
|
||||||
|
export default new Vue({});
|
@ -57,6 +57,7 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {createOrder} from '../../api/order';
|
import {createOrder} from '../../api/order';
|
||||||
|
import eventBus from '../eventBus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -122,10 +123,18 @@
|
|||||||
|
|
||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
|
|
||||||
|
console.log('activated')
|
||||||
//根据key名获取传递回来的参数,data就是map
|
//根据key名获取传递回来的参数,data就是map
|
||||||
this.$on('selectAddress', function (data) {
|
// eventBus.$on('selectaddress', function(data){
|
||||||
|
// //赋值给首页的附近医院数据模型
|
||||||
|
// console.log('selectaddress', data);
|
||||||
|
// }.bind(this));
|
||||||
|
|
||||||
|
//根据key名获取传递回来的参数,data就是map
|
||||||
|
this.$on('selectaddress', function (data) {
|
||||||
//赋值给首页的附近医院数据模型
|
//赋值给首页的附近医院数据模型
|
||||||
console.log(1);
|
console.log('selectaddress', data);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
hasDefault: data.isDefault,
|
hasDefault: data.isDefault,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.id !== 0) {
|
if (data.id) {
|
||||||
UpdateAddress(params).then(response => {
|
UpdateAddress(params).then(response => {
|
||||||
this.$toast('更新成功');
|
this.$toast('更新成功');
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import {GetAddressList} from "../../../api/user.js";
|
import {GetAddressList} from "../../../api/user.js";
|
||||||
import { AddressList } from 'vant';
|
import { AddressList } from 'vant';
|
||||||
|
import eventBus from '../../eventBus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -42,7 +43,9 @@
|
|||||||
if (!this.isSelect) {
|
if (!this.isSelect) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('selectAddress', item);
|
this.$emit('selectaddress', item);
|
||||||
|
//传递一个map,choiceHospital是key,hospital是value
|
||||||
|
// eventBus.$emit('selectaddress',item);
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user