Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zmr

This commit is contained in:
zmr900709 2020-07-03 10:52:08 +08:00
commit 4be45cafde
58 changed files with 1475 additions and 1578 deletions

View File

@ -2,5 +2,5 @@
export default {}
</script>
<style lang="scss">
@import "/static/css/normalize"
@import "/static/css/normalize";
</style>

View File

@ -32,3 +32,21 @@
- master分支将开启保护 请使用gitea合并功能
- 每人各自工作分支 每天合并
- 合并请及时拉取处理冲突
## 公共函数
```javascript
/**
* 转义富文本标签
* @param { String } temp 后台返回需要处理的富文本
* @return { String } 处理好的富文本
*/
unescapeHTML(temp){}
/**
* php时间戳转为格式化日期
* @param { String } timestamp 必填 php 返回的时间戳
* @param { String } spacer 可选 日期间隔符,默认 '-'
* @param { String } end 可选 年月日时分秒截止位置,默认 day可传 second
* @return { String } 格式化日期
*/
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {}
```

View File

@ -1,6 +1,68 @@
export default {
init(vm){
return {
// 发现列表
getArticlelist({ page, value, store_id, member_id, is_video_img }){
return vm.$u.post('article/articlelist', {
page: page,
like: value, // 搜索内容
store_id: store_id,
member_id: member_id,
is_video_img: is_video_img,
});
},
// 发现详情
getArticleInfo({ article_id }){
return vm.$u.post('article/articleInfo', {
article_id: article_id,
});
},
// 发现(取消)点赞
articleLike({ article_id }) {
return vm.$u.post('article/articleLike', {
article_id: article_id,
});
},
// 发现(取消)收藏
articleCollect({ article_id }) {
return vm.$u.post('article/articleCollect', {
article_id: article_id,
});
},
// 屏蔽用户
articleAddShield({ article_id, member_id }) {
return vm.$u.post('article/articleAddShield', {
article_id: article_id,
member_id: member_id,
});
},
// 推荐达人
getRecommendList(){
return vm.$u.post('MemberExpert/recommendList');
},
// 达人(搜索)列表
getExpertList({ page, store_id, live_status, like_nickname }){
return vm.$u.post('MemberExpert/expertList', {
page: page,
store_id: store_id,
live_status: live_status,
like_nickname: like_nickname,
});
},
// 达人详情
getExpertInfo({ member_id }){
return vm.$u.post('MemberExpert/expertInfo', {
member_id: member_id,
});
},
// 获取商城首页信息(顶部轮播图与商品分类)
getShopTopList(){
return vm.$u.post('Shop/getShopTopList');
},
// 商品分类列表(树结构)
getGoodsClassifyList() {
return vm.$u.post('Goods/getGoodsClassifyList');
},
// 商品推荐
getGoodsRecommend({page}){
return vm.$u.post('Goods/getGoodsRecommend', {
@ -10,6 +72,48 @@ export default {
// 购物车商品列表
getCartList() {
return vm.$u.post('cart/cartList');
},
// 购物车商品列表(树结构)
getCartTreeList() {
return vm.$u.post('cart/cartTreeList');
},
// 添加购物车
addCart({ goods_id, quantity }) {
return vm.$u.post('cart/cartAdd', {
goods_id: goods_id,
quantity: quantity
});
},
// 购物车删除商品
deleteCart({ id }) {
return vm.$u.post('cart/cartDel', {
cart_ids: id
});
},
// 购物车更新商品数量
cartUpdateNumber({ cart_id, quantity }) {
return vm.$u.post('cart/cartUpdate', {
cart_id: cart_id,
quantity: quantity
});
},
// 订单结算数据
settlementOrder({ cart_id }) {
return vm.$u.post('buy/buy_step1', {
cart_id: cart_id,
});
},
// 商品详情
getGoodsDetails({ id }) {
return vm.$u.post('Goods/goodDetails', {
goods_id: id
});
},
getStoreGoodsList({ id, page = 0}){
return vm.$u.post('Store/getStoreGoodsList', {
id: id,
page:page
});
}
}
}

View File

@ -56,16 +56,16 @@ export default {
});
},
// 使用帮助&售后政策列表
getUseHelpList({page, tid}) {
getUseHelpList({ page, tid }) {
return vm.$u.post('Member/UseHelpList', {
page: page,
tid: tid
tid: tid,
});
},
// 使用帮助&售后政策详情
getUseHelpInfo({ launch_id }) {
return vm.$u.post('Member/UseHelpInfo', {
launch_id: launch_id
launch_id: launch_id,
});
},
// 标签的列表
@ -75,11 +75,11 @@ export default {
// 获取地区列表
getAreaList({ pid }) {
return vm.$u.post('Area/areaList', {
pid: pid
pid: pid,
});
},
getArea() {
return vm.$u.post('Area/getAreaTree')
return vm.$u.post('Area/getAreaTree');
},
// 用户收货地址列表
getAddressList() {
@ -160,10 +160,68 @@ export default {
time: time
});
},
// 会员服务-积分数
getMemberPointsStat() {
return vm.$u.post('member/memberPointsStat');
},
// 会员服务-积分列表
getPointslogList() {
return vm.$u.post('member/pointslogList');
},
// 收藏列表 商品 不传值;店铺 type: 2
getFavoritesList({ type = undefined } = {}) {
let params = {};
if(type) Object.assign(params, {type: type})
return vm.$u.post('Member/getFavoritesList', params);
},
// 取消收藏(商品/店铺)
removeFavorite({ id }) {
return vm.$u.post('Member/removeFavorite', {
id: id,
});
},
// 设置-用户信息
getMemberInfo() {
return vm.$u.post('Member/MemberInfo');
},
// 设置-修改用户信息
updateMemberInfo({ nickname, gender, avatar, birthday }) {
return vm.$u.post('Member/changeMemberInfo', {
nickname: nickname,
sex: gender,
avatar: avatar,
birthday: birthday,
});
},
// 修改绑定手机号
changeMemberPhone({ old_mobile, old_code, new_mobile, new_code }) {
return vm.$u.post('Member/changeMemberInfo', {
old_mobile: old_mobile,
old_code: old_code,
new_mobile: new_mobile,
new_code: new_code,
});
},
// 设置-关于我们
aboutUsInfo() {
return vm.$u.post('Setting/AboutUsInfo');
},
// 设置-证照中心
certificateInfo() {
return vm.$u.post('Setting/CertificateInfo');
},
// 用户浏览记录
getBrowseList() {
return vm.$u.post('Member/BrowseList');
},
// 订单列表
getOrderList({ page }) {
return vm.$u.post('Goods/orderList', { page });
},
// 订单详情
getOrderInfo({ order_id }) {
return vm.$u.post('Goods/orderInfo', { order_id });
},
}
}
}

View File

@ -1,14 +1,27 @@
<template>
<view class="daren-item">
<image class="head"></image>
<text class="name">这是名字</text>
<text class="zhuangtai">直播状态</text>
<view class="daren-item" @click="toDetailsPage">
<image class="head" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu">关注</view>
</view>
</template>
<script>
export default {
name:"daren-item"
name:"daren-item",
props: {
info: Object,
},
methods: {
toDetailsPage() {
this.$u.route({
url: '',
params: {
name: 'lisa'
}
})
},
},
}
</script>
<style lang="scss" scoped>

View File

@ -1,16 +1,33 @@
<template>
<view class="video-item">
<image class="head">
</image>
<view class="title" v-if="!isguanzhu">这是标题这是标题这是标题</view>
<view class="jianjie">这是简介这是简介这是简介</view>
<view class="video-item" v-if="item" @click="toDetailsPage">
<image class="head" :src="item.article_pic"></image>
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
<view class="jianjie">{{ item.article_content }}</view>
<view class="user">
<view>
<image></image>
<text>这是名字</text>
<view class="info">
<image :src="item.member_avatar"></image>
<text>{{ item.member_nickname }}</text>
</view>
<image></image>
<image src="/static/image/common/4.png" @click.stop="showAction"></image>
<view class="action" v-if="show == item.article_id">
<view class="bubble">
<view @click="articleLike">
<image src="/static/image/common/5.png" v-if="item.is_like == 0"></image>
<image src="/static/image/common/8.png" v-else></image>
<text>点赞</text>
</view>
<view @click="articleCollect">
<image src="/static/image/common/6.png" v-if="item.is_collect == 0"></image>
<image src="/static/image/common/9.png" v-else></image>
<text>收藏</text>
</view>
<view @click="articleAddShield">
<image src="/static/image/common/7.png"></image>
<text>屏蔽用户</text>
</view>
</view>
</view>
<view class="layer" v-if="show == item.article_id" @click.stop="show=-1"></view>
</view>
</view>
</template>
@ -33,7 +50,7 @@
color: #333;
font-weight: 500;
line-height: 30rpx;
width: 307rpx;
width: 300rpx;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
@ -46,14 +63,13 @@
font-size: 22rpx;
color: #666;
line-height: 30rpx;
width: 307rpx;
width: 300rpx;
margin-left: 18rpx;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
.user{
display: flex;
@ -61,8 +77,9 @@
align-items: center;
margin:0 auto;
margin-top: 20rpx;
width: 307rpx;
>view{
width: 300rpx;
position: relative;
.info {
display: flex;
align-items: center;
>image{
@ -81,6 +98,70 @@
width: 37rpx;
height: 8rpx;
}
.action {
z-index: 19;
position: absolute;
right: 0rpx;
bottom: 55rpx;
// width: 234rpx;
background: rgba(255,255,255,1);
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
border-radius: 6rpx;
.bubble {
position: relative;
background-color: #fff;
&::after {
position: absolute;
right: 10rpx;
bottom: 0;
content: '';
width: 60rpx;
height: 40rpx;
background-color: inherit;
transform: rotate(45deg);
margin-top: -10rpx;
z-index: -1;
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
}
> view {
padding: 9rpx 12rpx;
display: flex;
align-items: center;
&:not(:last-child) {
border-bottom: 2rpx #ECECEC solid;
}
@mixin image-class($width, $height, $right) {
width: $width;
height: $height;
margin-right: $right;
}
> image {
&:first-child {
@include image-class($width: 21rpx, $height: 22rpx, $right: 12rpx);
}
&:nth-child(2) {
@include image-class($width: 22rpx, $height: 22rpx, $right: 12rpx);
}
&:last-child {
@include image-class($width: 24rpx, $height: 20rpx, $right: 9rpx);
}
}
> text {
font-size: 20rpx;
color: rgba(51,51,51,1);
}
}
}
}
.layer {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9;
background-color: transparent;
}
}
}
</style>
@ -89,9 +170,49 @@ export default {
name:"index-item",
data(){
return {
show: -1,
}
},
props:["isguanzhu"]
props:["isguanzhu", "item"],
mounted() {
// console.log(this.item);
this.show = -1;
},
methods: {
showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id;
},
articleLike() {
this.$u.api.articleLike({
article_id: this.item.article_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
articleCollect() {
this.$u.api.articleCollect({
article_id: this.item.article_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
articleAddShield() {
this.$u.api.articleAddShield({
article_id: this.item.article_id,
member_id: this.item.member_id,
}).then(res => {
if(res.errCode == 0) {
this.$emit("getArticlelist");
}
})
},
toDetailsPage() {
},
},
}
</script>

View File

@ -58,13 +58,13 @@ export default {
this.getAreaData();
},
created() {
// console.log(this.info);
console.log(typeof this.info);
this.initAddressInfo();
},
methods: {
//
initAddressInfo() {
if(JSON.stringify(this.info) != '{}') {
if(this.info) {
[this.name, this.phone, this.address, this.area, this.area_id, this.city_id] = [
this.info.address_realname,
this.info.address_mob_phone,
@ -78,7 +78,7 @@ export default {
},
// 
confirmBtn() {
JSON.stringify(this.info) != '{}' ? this.editAddress() : this.addAddress();
this.info ? this.editAddress() : this.addAddress();
},
//
validateValue() {
@ -121,7 +121,12 @@ export default {
this.$refs.uToast.show({
title: res.message,
type: 'success',
url: '/pageE/more/Address'
// url: '/pageE/more/Address',
callback() {
uni.redirectTo({
url: '/pageE/more/Address'
});
}
})
} else {
this.showToast(res.message, 'warning');
@ -146,7 +151,12 @@ export default {
this.$refs.uToast.show({
title: res.message,
type: 'success',
url: '/pageE/more/Address'
// url: '/pageE/more/Address',
callback() {
uni.redirectTo({
url: '/pageE/more/Address'
});
}
})
} else {
this.showToast(res.message, 'warning');

View File

@ -54,6 +54,7 @@ export default {
methods: {
editAddress() {
this.$u.route({
type: 'redirect',
url: '/pageE/more/EditAddress',
params: {
item: JSON.stringify(this.item)
@ -69,7 +70,7 @@ export default {
this.showToast(res.message, 'success');
this.$emit('getAddressList');
} else {
this.showToast(res.message, 'warning');
this.showToast(res.message, 'error');
}
})
},

View File

@ -1,5 +1,6 @@
<template>
<view class="article-list">
<u-empty text="数据为空" mode="data" color="#000000" img-width="240" margin-top="300" v-if="!articleList.length"></u-empty>
<view v-for="(item, index) in articleList" :key="index" class="list-item" @click="toDetailsPage(item)">
<view>{{ item.help_title }}</view>
<image src="@/pageE/static/mine/21.png"></image>
@ -20,7 +21,6 @@ export default {
type: 'navigateTo',
url: '/pageE/mine/ArticleDetails',
params: {
title: item.help_title,
id: item.help_id
}
})
@ -32,6 +32,7 @@ export default {
.article-list {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
overflow: hidden;
.list-item {
display: flex;
align-items: center;

View File

@ -1,11 +1,12 @@
<template>
<view class="collection-item">
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action
v-for="(item, index) in list" :key="index"
:index='index'
:show="item.show"
:options="options"
@click="click"
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
@ -43,7 +44,6 @@ export default {
show: false,
}
],
btnWidth: 152,
show: false,
options: [
{
@ -55,10 +55,25 @@ export default {
]
}
},
mounted() {
this.getGoodsFavoritesList();
},
methods: {
click(index) {
this.list.splice(index, 1);
this.$u.toast(`删除了第${index+1}个cell`);
getGoodsFavoritesList() {
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {}
})
},
removeFavorite(id) {
this.$u.api.removeFavorite({
id: id
}).then(res => {
if(res.errCode == 0) {
this.getGoodsFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},
open(index) {
// swipeActionprops

View File

@ -45,6 +45,7 @@
</template>
<script>
import common from '@/static/js/common.js'
export default {
data() {
return {
@ -90,10 +91,6 @@
this.videoContext = uni.createVideoContext('myVideo')
},
methods: {
unescapeHTML(temp) {
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
apiwelcome() {
this.$u.api.documentInfo({
document_code: 'agreement'
@ -101,7 +98,7 @@
if (res.errCode == 0) {
let agreement = res.data;
// console.log(agreement.document_content)
agreement.document_content = this.unescapeHTML(agreement.document_content);
agreement.document_content = common.unescapeHTML(agreement.document_content);
// console.log(agreement);
this.agreement = agreement;
}
@ -307,4 +304,4 @@
}
}
}
</style>
</style>

View File

@ -4,7 +4,6 @@
商品推荐
</view>
<view class="label">
<text>分类名称</text>
<text v-for="item in classifyList" :key="item.gc_id">{{ item.gc_name }}</text>
</view>
<view class="item">

View File

@ -1,6 +1,6 @@
<template>
<view class="item">
<image :src="$u.http.config.baseUrl + info.goods_image" class="img"></image>
<view class="item" @click="toDetailsPage">
<image :src="info.goods_image" class="img"></image>
<view class="info">
<text class="title u-line-1">{{ info.goods_name }}</text>
<text class="jianjie u-line-2">{{ info.goods_advword }}</text>
@ -13,7 +13,17 @@ export default {
name:"item",
props: {
info: Object
}
},
methods: {
toDetailsPage() {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.info.goods_id
}
})
}
},
}
</script>
<style lang="scss" scoped>

View File

@ -1,12 +1,15 @@
<template>
<view class="shop-item">
<image></image>
<text>1</text>
<image :src="info.goodscn_pic"></image>
<text class="u-line-1">{{ info.gc_name }}</text>
</view>
</template>
<script>
export default {
name:"shopItem",
props: {
info: Object,
}
}
</script>
<style lang="scss" scoped>
@ -18,9 +21,9 @@ export default {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
>text{
width: 80rpx;
font-size: 24rpx;
color: #333;
margin-top: 14rpx;

6
package-lock.json generated
View File

@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"uview-ui": {
"version": "1.3.68",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.3.68.tgz",
"integrity": "sha512-fwszoohFC1HLvIqwwnXPRytT52qGy0viGEzyJtVwemNBAu5z6Ddjwe9ORqsrlQQo7PSvHdyCNHWrSLGzoyKKoQ=="
"version": "1.4.3",
"resolved": "https://registry.npm.taobao.org/uview-ui/download/uview-ui-1.4.3.tgz?cache=0&sync_timestamp=1593581462515&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuview-ui%2Fdownload%2Fuview-ui-1.4.3.tgz",
"integrity": "sha1-iZXwicmK50MPu87vgbDDTBmm8eE="
}
}
}

View File

@ -13,6 +13,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"uview-ui": "^1.3.68"
"uview-ui": "^1.4.3"
}
}

View File

@ -115,6 +115,9 @@
},
//
loginOn() {
// uni.navigateTo({
// url: '/pageE/zhibo/index'
// });
console.log("登录")
// console.log(this.member_mobile)
// console.log(this.sms_code)

View File

@ -7,59 +7,56 @@
</template>
<script>
import common from '@/static/js/common.js'
var graceRichText = require("../../components/logininput/rictText.js");
export default {
data() {
return {
document_content : ''
export default {
data() {
return {
document_content : ''
}
},
onLoad(option) {
console.log(option)
//
let typeIindex = option.index;
this.typeIndexRquest(typeIindex)
},
methods: {
typeIndexRquest(typeIindex){
// 3 0 1 2 agreementopen_storeprivacyuse使
if(typeIindex == 0){
this.$u.api.documentInfo({
document_code: 'agreement'
}).then((res)=>{
console.log(res)
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
},
onLoad(option) {
console.log(option)
//
let typeIindex = option.index;
this.typeIndexRquest(typeIindex)
},
methods: {
unescapeHTML (temp){
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
typeIndexRquest(typeIindex){
// 3 0 1 2 agreementopen_storeprivacyuse使
if(typeIindex == 0){
this.$u.api.documentInfo({
document_code: 'agreement'
}).then((res)=>{
console.log(res)
let data = this.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
if(typeIindex == 1){
this.$u.api.documentInfo({
document_code: 'privacy'
}).then((res)=>{
console.log(res)
let data = this.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
if(typeIindex == 2){
this.$u.api.documentInfo({
document_code: 'use'
}).then((res)=>{
console.log(res)
let data = this.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
if(typeIindex == 1){
this.$u.api.documentInfo({
document_code: 'privacy'
}).then((res)=>{
console.log(res)
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
},
mounted(){
},
components:{}
}
if(typeIindex == 2){
this.$u.api.documentInfo({
document_code: 'use'
}).then((res)=>{
console.log(res)
let data = common.unescapeHTML(res.data.document_content);
this.document_content = data
})
}
}
},
mounted(){
},
components:{}
}
</script>
<style lang="scss" scoped>

View File

@ -1,12 +1,15 @@
<template>
<view class="nav">
<text>dsadasdas</text>
<image></image>
<text>{{ value }}</text>
<image src="/static/image/common/1.png"></image>
</view>
</template>
<script>
export default {
name:"navs"
name:"navs",
props: {
value: String
}
}
</script>
<style lang="scss" scoped>

View File

@ -2,24 +2,40 @@
<view class="tloos">
<view class="navs">
<image></image>
123
店铺
</view>
<view class="navs" style="margin-right:30rpx">
<image></image>
123
客服
</view>
<view class="button" style="background:rgba(253,211,96,0.6);">试穿试送</view>
<view class="button" style="background:rgba(253,211,96,1);">加入购物车</view>
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
<view class="button" style="background:rgba(255,120,15,1);">立即购买</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
name:"tloos"
name:"tloos",
props: ['id'],
methods: {
addCart() {
this.$u.api.addCart({
goods_id: this.id,
quantity: 1,
}).then(res => {
this.$refs.uToast.show({
title: res.message,
type: res.errCode == 0 ? 'success' : 'warning',
})
})
}
},
}
</script>
<style lang="scss" scoped>
.tloos{
background-color: #fff;
display: flex;
position: fixed;
height: 98rpx;

View File

@ -1,18 +1,15 @@
<template>
<view class="follow">
<view class="sosuo">
<image></image>
<view class="sosuo" @click="searchValue">
<image src="/static/image/common/10.png"></image>
<text>输入达人名称</text>
</view>
<view class="list">
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in 50"></darenItem>
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in recommendList" :key="item.id" :info="item"></darenItem>
</view>
</view>
</template>
<style lang="scss" scoped>
image{
background-color: #0f0;
}
.follow{
background-color: #ECECEC;
min-height: calc(100vh - var(--window-top));
@ -53,8 +50,25 @@ export default {
},
data(){
return{
recommendList: [], //
}
}
},
onShow() {
this.getRecommendList();
},
methods: {
getRecommendList() {
this.$u.api.getRecommendList().then(res => {
if(res.errCode == 0) {
this.recommendList = res.data.list;
}
})
},
searchValue() {
uni.navigateTo({
url: '/pageB/search/index'
})
},
},
}
</script>

View File

@ -3,27 +3,27 @@
<u-swiper :list="list" height="500" border-radius="0"></u-swiper>
<view class="info">
<view class="title">
<text>萨的环境</text>
套装新款小个子春季时尚韩版短袖衬衫套装
新款小个子春季时尚韩版...
<text>{{ goodsInfo.store_name }}</text>{{ goodsInfo.goods_name }}
</view>
<view class="pic">
<text>24</text>
<s>12</s>
<text>{{ goodsInfo.goods_price }}</text>
<s>{{ goodsInfo.goods_marketprice }}</s>
</view>
</view>
<view class="hr"></view>
<navs></navs>
<navs></navs>
<navs></navs>
<!-- <navs :value="领券"></navs> -->
<navs :value="'产品规格'"></navs>
<navs :value="'产品颜色'"></navs>
<navs :value="'选择尺码'"></navs>
<view class="xiangqing">
<view class="heng"></view>
<view class="title">商品详情</view>
<view class="heng"></view>
</view>
<tloos></tloos>
<view class="rich">
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
</view>
<tloos :id="goodsInfo.goods_commonid"></tloos>
</view>
</template>
<script>
@ -31,38 +31,46 @@ import navs from "../components/sdetails/navs"
import tloos from "../components/sdetails/tloos"
export default {
name:"sdetails",
data() {
return {
list: [],
goodsInfo: {},
}
},
components:{
navs,
tloos
},
data() {
return {
list: [{
image: '/static/uView/swiper/swiper1.jpg',
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
},
{
image: '/static/uView/swiper/swiper2.jpg',
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
},
{
image: '/static/uView/swiper/swiper3.jpg',
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
}
]
}
}
onLoad(option) {
this.getGoodsDetails(option.id);
},
methods: {
getGoodsDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
if (res.errCode == 0) {
this.goodsInfo = res.data;
this.goodsInfo.goods_image_mobile.forEach(item => {
let temp = {
image: item
}
this.list.push(temp);
})
// console.log(this.goodsInfo.mobile_body);
}
})
}
},
}
</script>
<style lang="scss" scoped>
.sdetails{
/deep/image{
background-color: #0f0;
}
padding-bottom: 98rpx;
.info{
padding: 30rpx;
.title{
flex-wrap: wrap;
margin-bottom: 30rpx;
>text{
padding: 13rpx;
font-size: 24rpx;
@ -109,5 +117,8 @@ export default {
margin: 0 20rpx;
}
}
.rich {
width: 100%;
}
}
</style>

View File

@ -12,45 +12,47 @@
<image src="../static/image/1.png" class="right"></image>
</view>
<view class="main">
<view class="goods-info">
<view class="store">
<image class="avatar"></image>
<view>胖胖的店</view>
<image src="../static/image/1.png" class="right"></image>
</view>
<view class="goods">
<view v-for="(goods, g_index) in 1" :key="g_index" class="goods-item">
<image></image>
<view class="info">
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
<view class="cart-info">
<view class="price">99</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index"></u-number-box>
<view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
<view class="goods-info">
<view class="store">
<image class="avatar" :src="item[0].store_avatar"></image>
<view>{{ item[0].store_name }}</view>
<image src="../static/image/1.png" class="right"></image>
</view>
<view class="goods">
<view v-for="(goods, g_index) in item" :key="g_index" class="goods-item">
<image :src="goods.goods_image_url"></image>
<view class="info">
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num"></u-number-box>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="order-info">
<view>
<view class="title">优惠券折扣</view>
<view class="value">
<view>-10.00</view>
<image src="../static/image/1.png"></image>
<view class="order-info">
<view>
<view class="title">优惠券折扣</view>
<view class="value">
<view>-10.00</view>
<image src="../static/image/1.png"></image>
</view>
</view>
</view>
<view>
<view class="title">配送方式</view>
<view class="value">
<view>快递</view>
<image src="../static/image/1.png"></image>
<view>
<view class="title">配送方式</view>
<view class="value">
<view>快递</view>
<image src="../static/image/1.png"></image>
</view>
</view>
</view>
<view>
<view class="title">支付方式</view>
<view class="value">
<view>微信</view>
<image src="../static/image/1.png"></image>
<view>
<view class="title">支付方式</view>
<view class="value">
<view>微信</view>
<image src="../static/image/1.png"></image>
</view>
</view>
</view>
</view>
@ -58,7 +60,7 @@
<view class="bottom">
<view class="left">
<view class="title">合计</view>
<view class="price">9.80</view>
<view class="price">{{ orderInfo.store_goods_total | showTotalPrice }}</view>
</view>
<view class="right">
<view class="num">共1件商品</view>
@ -70,9 +72,57 @@
<script>
export default {
data() {
return {}
return {
orderInfo: {},
totalPrice: '0.00',
}
},
filters: {
showTotalPrice(object) {
let price = 0;
for (const key in object) {
if (object.hasOwnProperty(key)) {
const element = object[key];
price += Number(element);
}
}
return price.toFixed(2);
}
},
onLoad(option) {
console.log(JSON.parse(option.info));
this.orderInfo = JSON.parse(option.info);
// this.orderListInit();
this.showTotalPrice();
},
methods: {
// orderListInit() {
// this.orderList = this.orderInfo.store_list;
// for (const key in this.orderList) {
// if (this.orderList.hasOwnProperty(key)) {
// const element = this.orderList[key];
// let tempArray = Object.entries(this.orderInfo.store_cart_list);
// tempArray.forEach(item => {
// if (item[0])
// })
// let temp = this.orderInfo.store_cart_list.filters(store => {
// return store.store_id == item.store_id
// })
// element
// }
// }
// this.orderList.forEach(item => {
// let temp = this.orderInfo.store_cart_list.filters(store => {
// return store.store_id == item.store_id
// })
// Object.assign(item, { goods_list: temp });
// })
// console.log(this.orderList);
// },
showTotalPrice() {
},
settlement() {
uni.navigateTo({
url: '/pageE/order/Details'
@ -127,75 +177,77 @@ export default {
}
}
.main {
.goods-info {
background-color: #ffffff;
padding: 30rpx;
margin-bottom: 2rpx;
.store {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
margin-right: 15rpx;
}
> view {
font-size: 28rpx;
color: rgba(51,51,51,1);
margin-right: 15rpx;
}
.right {
flex-shrink: 0;
width: 11rpx;
height: 22rpx;
}
}
.goods {
.goods-item {
> view {
.goods-info {
background-color: #ffffff;
padding: 30rpx;
margin-bottom: 2rpx;
.store {
display: flex;
align-items: center;
&:not(:last-child) {
margin-bottom: 20rpx;
margin-bottom: 20rpx;
.avatar {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
margin-right: 15rpx;
}
> image {
margin-right: 30rpx;
width: 180rpx;
height: 160rpx;
border-radius: 10rpx;
background-color: aqua;
> view {
font-size: 28rpx;
color: rgba(51,51,51,1);
margin-right: 15rpx;
}
.right {
flex-shrink: 0;
width: 11rpx;
height: 22rpx;
}
.info {
// width: 418rpx;
height: 160rpx;
}
.goods {
.goods-item {
display: flex;
flex-direction: column;
justify-content: space-between;
.name {
font-size: 30rpx;
color: rgba(51,51,51,1);
align-items: center;
&:not(:last-child) {
margin-bottom: 20rpx;
}
.cart-info {
> image {
margin-right: 30rpx;
width: 180rpx;
height: 160rpx;
border-radius: 10rpx;
background-color: aqua;
flex-shrink: 0;
}
.info {
// width: 418rpx;
height: 160rpx;
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
.price {
.name {
font-size: 30rpx;
font-weight: 500;
color: rgba(255,49,49,1);
color: rgba(51,51,51,1);
}
.u-numberbox {
border: 1rpx solid rgba(217,215,215,1);
border-radius:4px;
/deep/ .u-number-input {
margin: 0;
color: #333 !important;
border: 1rpx #D9D7D7 solid {
top: 0px;
bottom: 0px;
.cart-info {
display: flex;
align-items: center;
justify-content: space-between;
.price {
font-size: 30rpx;
font-weight: 500;
color: rgba(255,49,49,1);
}
.u-numberbox {
border: 1rpx solid rgba(217,215,215,1);
border-radius:4px;
/deep/ .u-number-input {
margin: 0;
color: #333 !important;
border: 1rpx #D9D7D7 solid {
top: 0px;
bottom: 0px;
}
}
}
}
@ -203,30 +255,30 @@ export default {
}
}
}
}
.order-info {
> view {
height: 98rpx;
background: rgba(255,255,255,1);
padding: 35rpx 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 2rpx;
.title {
font-size: 28rpx;
color: rgba(102,102,102,1);
}
.value {
.order-info {
> view {
height: 98rpx;
background: rgba(255,255,255,1);
padding: 35rpx 30rpx;
display: flex;
align-items: center;
font-size: 30rpx;
color:rgba(51,51,51,1);
> image {
width: 12rpx;
height: 22rpx;
flex-shrink: 0;
margin-left: 20rpx;
justify-content: space-between;
margin-bottom: 2rpx;
.title {
font-size: 28rpx;
color: rgba(102,102,102,1);
}
.value {
display: flex;
align-items: center;
font-size: 30rpx;
color:rgba(51,51,51,1);
> image {
width: 12rpx;
height: 22rpx;
flex-shrink: 0;
margin-left: 20rpx;
}
}
}
}

View File

@ -5,20 +5,20 @@
<view class="store">
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
<view class="name">
<image></image>
<view>胖胖的店</view>
<image :src="store.store_avatar"></image>
<view>{{ store.store_name }}</view>
</view>
</view>
<view class="goods">
<u-checkbox-group @change="goodsChange($event, s_index)">
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index" ></u-checkbox>
<image></image>
<image :src="goods.goods_image"></image>
<view class="info">
<view class="name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">99</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" @minus="reduce($event, s_index)" @plus="plus($event, s_index)"></u-number-box>
<view class="price">{{ goods.goods_price }}</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
</view>
</view>
</view>
@ -34,10 +34,11 @@
</u-checkbox-group>
<view class="total-price" v-if="status == '编辑'">
<view class="title">合计</view>
<view class="value">9.80</view>
<view class="value">{{ totalPrice }}</view>
</view>
<view class="cart-btn" v-if="status == '编辑'" @click="settlement">结算</view>
<view class="delete-btn" v-if="status == '完成'">删除</view>
<view class="cart-btn" v-if="status == '编辑'" @click="settlementOrder">结算</view>
<view class="delete-btn" v-if="status == '完成'" @click="deleteGoods">删除</view>
<u-toast ref="uToast" />
</view>
</view>
</template>
@ -46,55 +47,116 @@ export default {
data() {
return {
status: '编辑',
list: [
{
goods: [
{
checked: false
},
{
checked: false
}
],
checked: false
},
{
goods: [
{
checked: false
},
{
checked: false
}
],
checked: false
}
],
checkedAll: false
list: [],
checkedAll: false,
checkedGoods: [],
totalPrice: '0.00',
}
},
onLoad() {
watch: {
list: {
handler(cart){
let checkedGoods = [];
cart.forEach(store => {
let temp = store.goods.filter(goods => {
return goods.checked;
})
checkedGoods = checkedGoods.concat(temp);
})
// console.log(checkedGoods);
this.checkedGoods = checkedGoods;
this.calculatePrice();
},
deep: true
}
},
onShow() {
this.getCartList();
},
methods: {
getCartList() {
this.$u.api.getCartList().then((res)=>{
if (res.errCode == 0) {
console.log(res);
//
calculatePrice() {
// console.log(this.checkedGoods);
let temp = 0;
this.checkedGoods.forEach(item => {
temp += item.goods_num * (item.goods_price * 100) / 100;
})
this.totalPrice = temp.toFixed(2);
},
//
settlementOrder() {
let id = [], temp = '';
this.checkedGoods.forEach(item => {
temp = item.cart_id + '|' + item.goods_num;
id.push(temp);
temp = '';
})
// console.log(id);
this.$u.api.settlementOrder({ cart_id: id }).then(res => {
if(res.errCode == 0) {
this.$u.route({
url: '/pageC/cart/ConfirmOrder',
params: {
info: JSON.stringify(res.data),
}
})
}
})
},
reduce(value, store) {
console.log(value, store)
getCartList() {
this.$u.api.getCartTreeList().then(res => {
if (res.errCode == 0) {
let list = res.data.store_cart_list;
list.forEach((item, l_index) => {
// checked ,, false
Object.assign(item, { checked: this.list.length ? this.list[l_index].checked : false });
item.goods.forEach((goods, g_index) => {
Object.assign(goods, { checked: this.list.length ? this.list[l_index].goods[g_index].checked : false });
})
})
// console.log(list);
this.list = list;
}
})
},
plus(value, store) {
console.log(value, store)
deleteGoods() {
if(!this.checkedGoods.length) return false;
let id = [];
this.checkedGoods.forEach(item => {
id.push(item.cart_id);
})
// console.log(id);
this.$u.api.deleteCart({ id }).then(res => {
if (res.errCode == 0) {
if(!res.data.msg) {
this.getCartList();
} else {
this.$refs.uToast.show({
title: res.data.msg,
type: 'error',
})
}
}
})
},
settlement() {
uni.navigateTo({
url: './ConfirmOrder'
});
reduce(e) {
this.cartUpdateNumber(e.index, e.value);
},
plus(e) {
this.cartUpdateNumber(e.index, e.value);
},
async cartUpdateNumber(id, number) {
try {
await this.$u.api.cartUpdateNumber({
cart_id: id,
quantity: number,
}).then(res => {
this.getCartList();
})
} catch (error) {
this.getCartList();
}
},
totalChange(e) {
//
@ -147,7 +209,6 @@ export default {
// #ifdef APP-PLUS
let currentWebview = page.$getAppWebview();
let titleObj = currentWebview.getStyle().titleNView;
console.log(1);
console.log(JSON.stringify(titleObj.buttons[0]));
if (!titleObj.buttons) {
return;
@ -160,6 +221,7 @@ export default {
currentWebview.setStyle({
titleNView: titleObj
});
this.status = titleObj.buttons[0].text;
// #endif
}
@ -187,7 +249,7 @@ export default {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
border: 1rpx solid #000;
// border: 1rpx solid #000;
margin-right: 15rpx;
}
> view {

View File

@ -5,19 +5,19 @@
:scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" :class="[current == index ? 'u-tab-item-active' : '']"
@tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text>
<text class="u-line-1">{{item.gc_name}}</text>
</view>
</scroll-view>
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll">
<view class="page-view">
<view class="class-item" :id="'item' + index" v-for="(item , index) in tabbar" :key="index">
<view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index">
<view class="item-title">
<text>{{item.name}}</text>
<text>{{item.gc_name}}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item.foods" :key="index1">
<image class="item-menu-image" :src="item1.icon" mode=""></image>
<view class="item-menu-name">{{item1.name}}</view>
<view class="thumb-box" v-for="(item1, index1) in item._child" :key="index1">
<image class="item-menu-image" :src="item1.img" mode=""></image>
<view class="item-menu-name">{{item1.gc_name}}</view>
</view>
</view>
</view>
@ -27,7 +27,6 @@
</view>
</template>
<script>
import classifyData from '@/static/js/classify.data.js';
export default {
data() {
return {
@ -37,21 +36,28 @@
menuHeight: 0, //
menuItemHeight: 0, // item
itemId: '', // scroll-viewid
tabbar: classifyData,
tabbar: [],
menuItemPos: [],
arr: [],
scrollRightTop: 0, // scroll-view
timer: null, //
}
},
onLoad() {
onShow() {
this.getClassifyList();
},
onReady() {
this.getMenuItemTop()
},
methods: {
//
getClassifyList() {
this.$u.api.getGoodsClassifyList().then(res => {
if(res.errCode == 0) {
this.tabbar = res.data;
}
})
},
//
async swichMenu(index) {
if(this.arr.length == 0) {
@ -137,7 +143,7 @@
if(this.arr.length == 0) {
await this.getMenuItemTop();
}
if(this.timer) return ;
if(this.timer) return;
if(!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
@ -205,6 +211,7 @@
justify-content: center;
font-size: 28rpx;
color: #666666;
padding: 0 30rpx;
}
.u-tab-item-active {
position: relative;
@ -223,7 +230,7 @@
height: 100%;
}
.right-box {
background-color: rgb(250, 250, 250);
background-color: #fff;
}
.page-view {
padding: 16rpx;
@ -261,5 +268,6 @@
.item-menu-image {
width: 150rpx;
height: 150rpx;
margin-bottom: 15rpx;
}
</style>

View File

@ -40,8 +40,9 @@
<view class="classify" v-if="cur==0">
111
</view>
<view class="list" v-if="cur==1">
222
<!-- 商品筛选排序未完成 -->
<view class="item" v-if="cur==1">
<item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item>
</view>
</view>
<view class="tabbar">
@ -65,13 +66,18 @@
</view>
</template>
<script>
import item from "@/components/shop/list/item"
export default {
data() {
return {
show: false,
cur: 0
cur: 0,
list:[]
}
},
components:{
item
},
methods: {
toDetailsPage() {
uni.navigateTo({
@ -79,6 +85,12 @@ export default {
});
}
},
onLoad(){
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
console.log(res.data)
this.list= res.data.list
})
}
};
</script>
<style lang="scss" scoped>
@ -191,6 +203,9 @@ export default {
}
}
}
.main{
padding-bottom: 98rpx;
}
.tabbar {
border-top: 1rpx #DBDADA solid;
width: 100%;
@ -218,5 +233,12 @@ export default {
}
}
}
.item{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
// margin-top: 20rpx;
padding:25rpx;
}
}
</style>

View File

@ -4,16 +4,19 @@
</view>
</template>
<script>
import common from '@/static/js/common.js'
export default {
data() {
return {
nodes: `<p>13268748568645634nfdhf dfvjdfjgdfl vdufhnh1</p>123346<h1>das</h1><h1>das</h1><h1>das1</h1><h2>das2</h2><h3>das3</h3>`
nodes: '',
}
},
onLoad(option) {
console.log(option);
this.setTitle(option.title);
this.getUseHelpInfo(option.id);
// type: 1 2:
// console.log(option);
if(option.id) this.getUseHelpInfo(option.id);
if(option.type == 1) this.certificateInfo();
if(option.type == 2) this.getAboutUsInfo();
},
methods: {
setTitle(title){
@ -21,21 +24,32 @@ export default {
title: title
});
},
unescapeHTML (temp){
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
getUseHelpInfo(id) {
this.$u.api.getUseHelpInfo({
launch_id: id,
}).then((res)=>{
// console.log(res)
}).then(res => {
if (res.errCode == 0) {
this.nodes = this.unescapeHTML(res.data.info[0].help_info);
this.nodes = common.unescapeHTML(res.data.info[0].help_info);
this.setTitle(res.data.info[0].help_title);
}
})
}
},
getAboutUsInfo() {
this.$u.api.aboutUsInfo().then(res => {
if (res.errCode == 0) {
this.nodes = common.unescapeHTML(res.data.info.value);
this.setTitle(res.data.info.remark);
}
})
},
certificateInfo() {
this.$u.api.certificateInfo().then(res => {
if (res.errCode == 0) {
this.nodes = common.unescapeHTML(res.data.info.value);
this.setTitle(res.data.info.remark);
}
})
},
},
}
</script>

View File

@ -6,32 +6,100 @@
</view>
<view class="info-item">
<view class="title">昵称</view>
<view class="value">胖胖</view>
<view class="value">
<input type="text" v-model="nickname" />
</view>
</view>
<view class="info-item">
<view class="title">性别</view>
<view class="value"></view>
<view class="value" @click="selectGender=true">{{ gender == '1' ? '' : '' }}</view>
</view>
<u-select v-model="selectGender" mode="single-column" :list="list" @confirm="setGender"></u-select>
<view class="info-item">
<view class="title">生日</view>
<view class="value">1998.10.13</view>
<view class="value" @click="selectBirthday=true">{{ birthday }}</view>
</view>
<u-picker mode="time" v-model="selectBirthday" :params="params" @confirm="setBirthday"></u-picker>
<view class="info-item phone" @click="updatePhone">
<view class="title">手机号</view>
<view class="value">18265906216</view>
<view class="value">{{ phoneNumber }}</view>
<image src="../static/mine/21.png"></image>
</view>
</view>
<view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系后台</view>
<view class="edit-btn">完成</view>
<view class="edit-btn" @click="updateMemberInfo">完成</view>
</view>
</template>
<script>
import common from '@/static/js/common.js'
export default {
data() {
return {}
return {
selectGender: false,
selectBirthday: false,
list: [
{
value: 1,
label: '男'
},
{
value: 2,
label: '女'
}
],
params: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
},
nickname: '胖胖',
gender: '', // 1 2
birthday: '',
phoneNumber: '',
avatar: '',
}
},
onLoad() {
this.getUserInfo();
},
methods: {
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {
let userInfo = res.data.MemberArray;
[this.nickname, this.phoneNumber, this.birthday, this.gender, this.avatar] = [
userInfo.member_nickname,
userInfo.member_mobile,
common.timestampToDate({timestamp: userInfo.member_birthday}),
userInfo.member_sex,
userInfo.member_avatar,
];
}
})
},
updateMemberInfo() {
this.$u.api.updateMemberInfo({
nickname: this.nickname,
gender: this.gender,
avatar: this.avatar,
birthday: this.birthday,
}).then(res => {
if (res.errCode == 0) {
this.getUserInfo();
}
})
},
setGender(value) {
// console.log(value);
this.gender = value[0].value;
},
setBirthday(value) {
// console.log(value);
this.birthday = value.year + '-' + value.month + '-' + value.day;
},
updatePhone() {
uni.navigateTo({
url: '/pageE/mine/UpdatePhone'
@ -71,7 +139,13 @@ export default {
color: rgba(51,51,51,1);
}
.value {
flex: 1;
height: 98rpx;
line-height: 98rpx;
color: rgba(102,102,102,1);
> input {
height: 98rpx;
}
}
}
.phone {

View File

@ -9,11 +9,11 @@
<view class="integral-top">
<view>
<view class="title">总积分</view>
<view class="value">999</view>
<view class="value">{{ memberInfo.member_points }}</view>
</view>
<view>
<view class="title">经验值</view>
<view class="value">999</view>
<view class="value">{{ memberInfo.member_exppoints }}</view>
</view>
<view>
<view class="title">预计进度</view>
@ -71,10 +71,12 @@ export default {
current: 0,
swiperCurrent: 0,
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>',
pointslogList: []
pointslogList: [],
memberInfo: {}
}
},
onShow() {
this.getMemberPointsStat();
this.getPointslogList();
},
methods: {
@ -86,6 +88,13 @@ export default {
this.swiperCurrent = current;
this.current = current;
},
getMemberPointsStat() {
this.$u.api.getMemberPointsStat().then((res)=>{
if (res.errCode == 0) {
this.memberInfo = res.data;
}
})
},
getPointslogList() {
this.$u.api.getPointslogList().then((res)=>{
if (res.errCode == 0) {

View File

@ -5,43 +5,61 @@
</view>
<view class="info-item">
<view class="title">昵称</view>
<view class="value">胖胖</view>
<view class="value">{{ userInfo.member_nickname }}</view>
</view>
<view class="info-item">
<view class="title">性别</view>
<view class="value"></view>
<view class="value">{{ userInfo.member_sex == 1 ? '男' : '' }}</view>
</view>
<view class="info-item">
<view class="title">生日</view>
<view class="value">1998.10.13</view>
<view class="value">{{ userInfo.member_birthday | dateFormat }}</view>
</view>
<view class="info-item">
<view class="title">手机号</view>
<view class="value">18265906216</view>
<view class="value">{{ userInfo.member_mobile }}</view>
</view>
<view class="info-item">
<view class="title">等级</view>
<view class="value">9999</view>
<view class="value">{{ userInfo.level }}</view>
</view>
<view class="info-item">
<view class="title">积分数</view>
<view class="value">9999</view>
<view class="value">{{ userInfo.member_points }}</view>
</view>
<view class="info-item">
<view class="title">经验值</view>
<view class="value">9999</view>
<view class="value">{{ userInfo.member_exppoints }}</view>
</view>
</view>
</template>
<script>
import common from '@/static/js/common.js'
export default {
data() {
return {}
return {
userInfo: {}
}
},
onLoad() {
this.getUserInfo();
},
onNavigationBarButtonTap() {
this.toEditPage();
},
filters: {
dateFormat(value) {
return common.timestampToDate({ timestamp: value });
}
},
methods: {
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {
this.userInfo = res.data.MemberArray;
}
})
},
toEditPage() {
uni.navigateTo({
url: '/pageE/mine/EditUserInfo'

View File

@ -1,11 +1,12 @@
<template>
<view class="store">
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action
v-for="(item, index) in list" :key="index"
:index='index'
:show="item.show"
:options="options"
@click="click"
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
@ -26,21 +27,7 @@
export default {
data() {
return {
list: [
{
id: 1,
show: false
},
{
id: 2,
show: false
},
{
id: 3,
show: false,
}
],
btnWidth: 152,
list: [],
show: false,
options: [
{
@ -52,10 +39,25 @@ export default {
]
}
},
mounted() {
this.getStoreFavoritesList();
},
methods: {
click(index) {
this.list.splice(index, 1);
this.$u.toast(`删除了第${index+1}个cell`);
getStoreFavoritesList() {
this.$u.api.getFavoritesList({
type: 2 // type: 2
})
},
removeFavorite(id = 18) {
this.$u.api.removeFavorite({
id: id
}).then(res => {
if(res.errCode == 0) {
this.getStoreFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},
open(index) {
// swipeActionprops
@ -70,6 +72,9 @@ export default {
</script>
<style lang="scss" scoped>
.store {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
padding-top: 1rpx;
.item {
padding: 30rpx;
display: flex;

View File

@ -9,7 +9,8 @@
<view class="code">
<view class="title">验证码</view>
<input type="text" v-model="oldCode" placeholder="请输入验证码" />
<view class="get-code">获取验证码</view>
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uOldCode" @change="oldCodeChange" unique-key="old" change-text="x秒"></u-verification-code>
<view class="get-code" @click="getCode(0)">{{ btnText[0] }}</view>
</view>
</view>
<view class="new-phone">
@ -20,8 +21,10 @@
<view class="code">
<view class="title">验证码</view>
<input type="text" v-model="newCode" placeholder="请输入验证码" />
<view class="get-code">获取验证码</view>
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uNewCode" @change="newCodeChange" unique-key="new" change-text="x秒"></u-verification-code>
<view class="get-code" @click="getCode(1)">{{ btnText[1] }}</view>
</view>
<u-toast ref="uToast" />
</view>
</view>
<view class="tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系后台</view>
@ -35,13 +38,80 @@ export default {
oldNumber: '',
oldCode: '',
newNumber: '',
newCode: ''
newCode: '',
btnText: ['获取验证码', '获取验证码'],
seconds: 60, //
}
},
methods: {
verifyValue() {
if (this.$u.test.mobile(this.oldNumber)) this.$u.toast('请填写正确的原手机号');
if (this.$u.test.mobile(this.newNumber)) this.$u.toast('请填写正确的新手机号');
verifyValue(type) {
const phone = type == 0 ? this.oldNumber : this.newNumber;
return this.$u.test.mobile(phone);
},
// @param Number type 0: 1:
getSmsCode (type) {
if(!this.verifyValue(type)) {
let tips = type == 0 ? '请填写正确的原手机号' : '请填写正确的新手机号';
this.$u.toast(tips);
return false;
}
if(this.seconds > 0) {
this.$u.toast('倒计时结束后再发送');
}
uni.showLoading({
title: '正在获取验证码'
})
this.$u.api.sendSmsCode({
member_mobile: type == 0 ? this.oldNumber: this.newNumber,
smslog_type: 4 // [1:,2:,3:,4:]
}).then(res => {
uni.hideLoading();
if(res.errCode == 0) {
} else {
this.$u.toast(res.message);
}
})
},
oldCodeChange(text) {
this.$set(this.btnText, 0, text);
},
newCodeChange(text) {
this.$set(this.btnText, 1, text);
},
getCode(type) {
const refs = type == 0 ? this.$refs.uOldCode : this.$refs.uNewCode;
if(refs.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
this.$u.toast('验证码已发送');
//
refs.start();
}, 2000);
} else {
this.$u.toast('倒计时结束后再发送');
}
},
changeMemberPhone() {
this.$u.api.changeMemberPhone({
old_mobile: this.oldNumber,
old_code: this.oldCode,
new_mobile: this.newNumber,
new_code: this.newCode,
}).then(res => {
})
},
end() {
this.$u.toast('倒计时结束');
},
start() {
this.$u.toast('倒计时开始');
}
},
};
@ -64,15 +134,17 @@ export default {
color: rgba(51,51,51,1);
}
.input {
flex: 1;
width: 340rpx;
font-size: 26rpx;
}
.get-code {
flex: 1;
font-size: 28rpx;
color: rgba(153,153,153,1);
position: relative;
padding: 0 25rpx;
margin-left: 20rpx;
text-align: center;
&::after {
position: absolute;
content: "";

View File

@ -1,6 +1,7 @@
<template>
<view class="address">
<u-radio-group v-model="current" @change="changeDefault" size="29" active-color="#FF780F">
<u-empty text="暂无收货地址" mode="address" color="#000000" img-width="120" margin-top="300" v-if="!addressList.length"></u-empty>
<view v-for="(item, index) in addressList" :key="index" class="address-item">
<AddressItem :item="item" :current='current' @getAddressList="getAddressList"></AddressItem>
</view>
@ -14,14 +15,14 @@ import AddressItem from '@/components/mine/address-block/address-item'
export default {
data() {
return {
current: -1,
current: -1, // radio
addressList: []
}
},
components: {
AddressItem
},
onLoad() {
onShow() {
this.getAddressList();
},
methods: {
@ -46,7 +47,7 @@ export default {
// console.log(id)
this.$u.api.setDefaultAddress({
address_id: id
}).then((res)=>{
}).then(res => {
if(res.errCode == 0) {
this.getAddressList();
} else {

View File

@ -9,7 +9,6 @@ export default {
data() {
return {
page: 1,
type: '售后政策',
policyList: []
}
},

View File

@ -78,7 +78,8 @@
export default {
data() {
return {
current: 0
current: 0,
orderInfo: {}
}
},
onLoad(option) {
@ -87,6 +88,15 @@ export default {
this.setTitle();
},
methods: {
getOrderInfo(id) {
this.$u.api.getOrderInfo({
order_id: id,
}).then(res => {
if(res.errCode == 0) {
this.orderInfo = res.data;
}
})
},
setTitle(){
let title = ''
switch (this.current) {

View File

@ -112,8 +112,18 @@ export default {
this.current = Number(option.current);
this.swiperCurrent = this.current;
}
this.getOrderList();
},
methods: {
getOrderList() {
this.$u.api.getOrderList({
page: this.page,
}).then(res => {
if(res.errCode == 0) {
}
})
},
reachBottom() {
// console.log(this.page);
if(this.page >= 3) return;

View File

@ -57,11 +57,11 @@ export default {
},
{
title: '证件中心',
link: '../mine/ArticleDetails?title=证件照中心'
link: '../mine/ArticleDetails?type=1'
},
{
title: '关于我们',
link: '../mine/ArticleDetails?title=关于我们'
link: '../mine/ArticleDetails?type=2'
},
{
title: '帮助与反馈',

View File

@ -6,7 +6,8 @@
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y class="order-list" @scrolltolower="reachBottom">
<view>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
<view v-else>
<view v-for="(item, index) in orderList" :key="index" class="order-item">
<view class="order-title">
<view class="order-text">订单</view>
@ -46,7 +47,13 @@ export default {
onShow() {
this.current = 0;
this.swiperCurrent = 0;
this.getManicureList();
this.getManicureList().then(order => {
// console.log(order);
this.orderList = this.orderList.concat(order);
// console.log(this.orderList);
});
},
filters: {
dateFormat(value) {
@ -59,26 +66,27 @@ export default {
}
},
methods: {
getManicureList() {
this.$u.api.getManicureList({
async getManicureList() {
let res = await this.$u.api.getManicureList({
page: this.page
}).then((res)=>{
if (res.errCode == 0) {
this.orderList = res.data.list;
}
})
if (res.errCode == 0) {
return res.data.list;
}
},
reachBottom() {
// console.log(this.page);
if(this.page >= 3) return;
// loadStatus
console.log(this.loadStatus);
this.loadStatus.splice(this.current, 1, "loading");
this.loadStatus = "loading";
this.page++;
setTimeout(() => {
this.orderList += 5;
this.loadStatus.splice(this.current, 1, "nomore");
}, 1200);
this.getManicureList().then(order => {
if (!order.length) {
// page-1
this.page--;
this.loadStatus = "nomore";
} else {
this.orderList = this.orderList.concat(order);
}
})
},
tabsChange(index) {
this.swiperCurrent = index;

View File

@ -55,8 +55,15 @@ export default {
name: this.name,
time: new Date(this.time)
}).then((res)=>{
let type = res.errCode == 0 ? 'success' : 'error';
this.showToast(res.message, type);
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
type: 'success',
url: '/pageE/tool/Manicure'
})
} else {
this.showToast(res.message, 'error');
}
})
},
chooseDate(e) {

View File

@ -3,19 +3,20 @@
<view class="history-box">
<view v-for="(item, index) in historyList" :key="index" class="history-item">
<view class="item-title">
<img src="../static/mine/23.png" />
<image src="../static/mine/23.png"></image>
<view>小米店铺</view>
</view>
<!-- <view class="item-image">
<img src="../static/mine/23.png" />
</view> -->
<img src="../static/mine/23.png" class="item-image" />
<image src="../static/mine/23.png" class="item-image"></image>
<view class="item-info">
<view class="info-name">{{ item }}</view>
<img src="../static/mine/22.png" />
<image src="../static/mine/22.png"></image>
</view>
</view>
</view>
<u-empty text="暂无足迹" mode="list" color="#000" margin-top="240" v-if="!historyList.length"></u-empty>
</view>
</template>
@ -26,8 +27,18 @@ export default {
historyList: [1, 2, 3, 6]
};
},
onLoad() {},
methods: {}
onLoad() {
this.getBrowseList();
},
methods: {
getBrowseList () {
this.$u.api.getBrowseList().then(res => {
if(res.errCode == 0) {
this.historyList = res.data.storeInfo;
}
})
}
}
};
</script>
<style lang="scss" scoped>
@ -48,7 +59,7 @@ export default {
.item-title {
display: flex;
align-items: center;
> img {
> image {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
@ -73,7 +84,7 @@ export default {
font-size: 22rpx;
color: rgba(51,51,51,1);
}
> img {
> image {
width: 37rpx;
height: 8rpx;
}

101
pageE/zhibo/index.nvue Normal file
View File

@ -0,0 +1,101 @@
<template>
<view>
<live-pusher id='livePusher' ref="livePusher" class="livePusher" url=""
mode="SD" :muted="true" :enable-camera="true" :auto-focus="true" :beauty="0" whiteness="0"
aspect="9:16" @statechange="statechange" @netstatus="netstatus" @error = "error"
style="width:750rpx;height:750rpx"></live-pusher>
<button class="btn" @click="start">开始推流</button>
<button class="btn" @click="pause">暂停推流</button>
<button class="btn" @click="resume">resume</button>
<button class="btn" @click="stop">停止推流</button>
<button class="btn" @click="snapshot">快照</button>
<button class="btn" @click="startPreview">开启摄像头预览</button>
<button class="btn" @click="stopPreview">关闭摄像头预览</button>
<button class="btn" @click="switchCamera">切换摄像头</button>
</view>
</template>
<script>
export default {
data: {
fil: true
},
onReady() {
// 注意需要在onReady中 或 onLoad 延时
this.context = uni.createLivePusherContext("livePusher", this);
},
methods: {
statechange(e) {
console.log("statechange:" + JSON.stringify(e));
},
netstatus(e) {
console.log("netstatus:" + JSON.stringify(e));
},
error(e) {
console.log("error:" + JSON.stringify(e));
},
start: function() {
this.context.start({
success: (a) => {
console.log("livePusher.start:" + JSON.stringify(a));
}
});
},
close: function() {
this.context.close({
success: (a) => {
console.log("livePusher.close:" + JSON.stringify(a));
}
});
},
snapshot: function() {
this.context.snapshot({
success: (e) => {
console.log(JSON.stringify(e));
}
});
},
resume: function() {
this.context.resume({
success: (a) => {
console.log("livePusher.resume:" + JSON.stringify(a));
}
});
},
pause: function() {
this.context.pause({
success: (a) => {
console.log("livePusher.pause:" + JSON.stringify(a));
}
});
},
stop: function() {
this.context.stop({
success: (a) => {
console.log(JSON.stringify(a));
}
});
},
switchCamera: function() {
this.context.switchCamera({
success: (a) => {
console.log("livePusher.switchCamera:" + JSON.stringify(a));
}
});
},
startPreview: function() {
this.context.startPreview({
success: (a) => {
console.log("livePusher.startPreview:" + JSON.stringify(a));
}
});
},
stopPreview: function() {
this.context.stopPreview({
success: (a) => {
console.log("livePusher.stopPreview:" + JSON.stringify(a));
}
});
}
}
}
</script>

View File

@ -83,7 +83,7 @@
{
"path": "follow/index",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "推荐达人列表",
"app-plus":{
"titleNView":{
"backgroundColor":"#ffffff"
@ -155,12 +155,6 @@
"text":"搜索",
"float":"right",
"fontSize":"16"
},
{
"type":"none",
"text":"\ue582",
"float":"left",
"fontSize":"16"
}
],
"searchInput": {
@ -317,9 +311,6 @@
}
}
}
]
},
{

View File

@ -23,14 +23,13 @@
<indexad style="width:690rpx"></indexad>
<view class="list">
<view >
<videoItem v-for="item in 10"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem v-for="item in 10"></videoItem>
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
@ -53,26 +52,27 @@
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="tuijian">
<view class="title">
<view class="title" @click="toSearchPage">
<view class="left">
<view></view>
<text>推荐达人</text>
</view>
<image class="right"></image>
<image class="right" src="/static/image/common/1.png"></image>
</view>
<view class="tuijianlist">
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem>
<darenItem></darenItem>
<!-- <darenItem style="margin-right:23rpx"></darenItem>
<darenItem style="margin-right:23rpx"></darenItem> -->
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item"></darenItem>
</view>
</view>
<view class="list">
<view >
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
<view style="margin-left:20rpx">
<videoItem isguanzhu="true" v-for="item in 10"></videoItem>
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
</view>
</view>
</view>
@ -155,6 +155,9 @@
height: 282rpx;
margin-top: 30rpx;
display: flex;
> view:not(:last-child) {
margin-right: 23rpx;
}
}
}
}
@ -178,7 +181,10 @@ export default {
name: '关注'
}
],
num:0
num:0,
page: 0, // 0
articleList: [],
recommendList: [], //
}
},
components:{
@ -187,23 +193,42 @@ export default {
indexad,
darenItem
},
onShow(){
this.getArticlelist();
this.getRecommendList();
},
methods:{
dianji(a){
console.log(a)
// console.log(a)
if(typeof a == "object"){
this.num = a.detail.current
}else{
this.num = a
}
}
},
getArticlelist () {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: 0, // 1 2 0
}).then(res => {
if(res.errCode == 0) {
this.articleList = res.data.list;
}
})
},
getRecommendList() {
this.$u.api.getRecommendList().then(res => {
console.log(res)
if(res.errCode == 0) {
this.recommendList = res.data.list;
}
})
},
toSearchPage() {
uni.navigateTo({
url: '/pageB/follow/index'
})
},
},
onLoad(){
// this.$u.api.phoneLogin({
// member_mobile: 1,
// sms_code: 2
// }).then((res)=>{
// console.log(res)
// })
}
}
</script>

View File

@ -34,7 +34,6 @@
export default {
data() {
return {
//
information_dl: [{
id: 0,

View File

@ -5,26 +5,26 @@
<image src="/static/image/mine/23.png" class="avatar" @click="toOtherPage('/mine/MineInfo')" />
<view class="user-info">
<view class="info-left">
<view class="user-nickname" @click="toOtherPage('/mine/MineInfo')">小同学</view>
<view class="user-nickname" @click="toOtherPage('/mine/MineInfo')">{{ userInfo.member_nickname }}</view>
<view class="user-medal" @click="toOtherPage('/mine/MedalIntroduction')">
<img src="/static/image/mine/13.png" />
<view class="rank-title">勋章</view>
</view>
</view>
<view class="info-right">
<view class="info-phone">123***5694</view>
<view class="user-rank">等级:34</view>
<view class="info-phone">{{ userInfo.member_mobile | phoneFormat }}</view>
<view class="user-rank">等级:{{ userInfo.level }}</view>
</view>
</view>
<view class="member-service" @click="toOtherPage('/mine/MemberServe')">会员服务</view>
</view>
<view class="bottom">
<view @click="toOtherPage('/mine/GoodsCollection')">
<view>99</view>
<view>{{ userInfo.member_fav_goods_num }}</view>
<view>商品收藏</view>
</view>
<view @click="toOtherPage('/mine/StoreCollection')">
<view>9</view>
<view>{{ userInfo.member_fav_store_num }}</view>
<view>店铺收藏</view>
</view>
<view @click="toOtherPage('/mine/ImageTextCollection')">
@ -32,11 +32,11 @@
<view>图文收藏</view>
</view>
<view @click="toOtherPage('/mine/Integral')">
<view>9</view>
<view>{{ userInfo.member_points }}</view>
<view>积分数</view>
</view>
<view @click="toOtherPage('/mine/MineConcerns')">
<view>9</view>
<view>{{ userInfo.member_snsfrend_num }}</view>
<view>关注</view>
</view>
</view>
@ -123,17 +123,29 @@
export default {
data() {
return {
title: "2"
userInfo: {},
};
},
onLoad() {},
},
filters: {
phoneFormat(value) {
return value ? value.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2') : '';
}
},
onLoad() {
this.getUserInfo();
},
onNavigationBarButtonTap() {
console.log("setting");
this.toOtherPage("/setting/Index");
},
methods: {
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {
this.userInfo = res.data.MemberArray;
}
})
},
toOtherPage(url) {
// console.log(url);
uni.navigateTo({
url: '/pageE' + url
});
@ -146,7 +158,7 @@ export default {
min-height: calc(calc(100vh - var(--window-top)) - 50px);
background: #ECECEC;
.mine-top {
width: 750rpx;
// width: 100%;
height: 272rpx;
background: #FF780F;
.top {
@ -173,7 +185,7 @@ export default {
}
.user-medal {
display: flex;
// width: 87rpx;
width: 110rpx;
// height: 25rpx;
background: linear-gradient(269deg,rgba(175,175,175,1) 0%,rgba(224,224,224,1) 100%);
border-radius: 13rpx;

View File

@ -7,9 +7,9 @@
<image src="/static/image/shop/2.png"></image>
</view>
<u-search placeholder="日照香炉生紫烟" v-model="keyword" :show-action="false" bg-color="#fff" border-color="#999999"></u-search>
<image src="/static/image/shop/3.png" class="mnue"></image>
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
</view>
<u-swiper :list="list"></u-swiper>
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
<view class="chengnuo">
<view>
<image src="/static/image/shop/4.png"></image>
@ -28,11 +28,11 @@
<text>上门取件</text>
</view>
</view>
<view class="fenlei">
<!-- <view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
</view>
</view> -->
<view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
</view>
<view class="hr" style="margin-top:80rpx"></view>
<recommend></recommend>
@ -46,6 +46,9 @@
<youhq></youhq>
<view class="hr" style="margin-top:40rpx"></view>
<list :classifyList="classifyList" :goodsList="goodsList"></list>
<view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image>
</view>
<u-picker mode="region" :params="areaParams" v-model="chooseArea" @confirm="setArea"></u-picker>
</view>
</template>
@ -69,7 +72,7 @@ export default {
},
data(){
return {
area: "北京市",
area: "请选择",
chooseArea: false,
areaParams: {
province: true,
@ -77,33 +80,37 @@ export default {
area: false
},
keyword:"",
list:[{
image: '/static/uView/swiper/swiper1.jpg',
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
},
{
image: '/static/uView/swiper/swiper2.jpg',
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
},
{
image: '/static/uView/swiper/swiper3.jpg',
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
}
],
list:[],
goodsClassify: [], //
classifyList: [],
goodsList: []
}
},
onLoad() {
console.log(this.$u.http)
this.getShopTopList();
this.getGoodsRecommend();
},
methods: {
getShopTopList() {
this.$u.api.getShopTopList().then((res)=>{
if (res.errCode == 0) {
let temp = [];
res.data.banner.forEach(item => {
temp.push({
image: item.adv_code,
adv_link: item.adv_link,
adv_id: item.adv_id,
})
})
this.list = temp;
this.goodsClassify = res.data.goodsclass;
}
})
},
getGoodsRecommend() {
this.$u.api.getGoodsRecommend({
page: 1,
}).then((res)=>{
console.log(res);
if (res.errCode == 0) {
this.classifyList = res.data.classifyList;
this.goodsList = res.data.goodsList;
@ -112,10 +119,25 @@ export default {
}
})
},
clickImage(index) {
console.log(index);
console.log(this.list[index]);
},
setArea(e) {
// console.log(e);
this.area = e.city.label;
}
},
toCartPage() {
uni.navigateTo({
url: '/pageC/cart/index'
});
},
toClassifyPage() {
uni.navigateTo({
url: '/pageC/classify/index'
});
},
},
}
</script>
@ -176,8 +198,15 @@ export default {
}
.fenlei{
display: flex;
justify-content: space-between;
// justify-content: space-between;
margin-top: 30rpx;
flex-wrap: wrap;
> view {
margin-bottom: 30rpx;
&:not(:nth-child(5n)) {
margin-right: 70rpx;
}
}
}
.hr{
width: 750rpx;
@ -192,5 +221,22 @@ export default {
margin-top: 29rpx;
background-color: #ececec;
}
.cart {
position: fixed;
right: 30rpx;
bottom: 300rpx;
width: 100rpx;
height: 100rpx;
background: rgba(253, 211, 96, 1);
box-shadow: 0rpx 10rpx 6rpx 0rpx rgba(253,211,96,0.34);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
> image {
width: 56rpx;
height: 54rpx;
}
}
}
</style>

BIN
static/image/common/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/image/common/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
static/image/common/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/image/common/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
static/image/common/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

BIN
static/image/common/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/image/common/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/image/common/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/image/common/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/image/common/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

File diff suppressed because it is too large Load Diff

34
static/js/common.js Normal file
View File

@ -0,0 +1,34 @@
const common = {
/**
* 转义富文本标签
* @param { String } temp 后台返回需要处理的富文本
* @return { String } 处理好的富文本
*/
unescapeHTML(temp){
if(!temp) return '';
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
/**
* php时间戳转为格式化日期
* @param { String } timestamp 必填 php返回的时间戳
* @param { String } spacer 可选 日期间隔符,默认 '-'
* @param { String } end 可选 年月日时分秒截止位置默认 day可传 second
* @return { String } 格式化日期
*/
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {
if(!timestamp) return '';
const newDate = new Date(parseInt(timestamp) * 1000);
// const year = newDate.getUTCFullYear();
const year = newDate.getFullYear();
const month = newDate.getMonth() + 1;
const nowday = newDate.getDate();
const hours = newDate.getHours();
const minutes = newDate.getMinutes();
const seconds = newDate.getSeconds();
return end == 'day'
? year + spacer + month + spacer + nowday
: year + spacer + month + spacer + nowday + spacer + hours + spacer + minutes + spacer + seconds;
}
}
export default common