Commit a61452ab authored by 郑秀明's avatar 郑秀明

Merge branch 'wjw_dev'

parents faa0b1b1 63a15dd0
No preview for this file type
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
/node_modules /node_modules
/npm-debug.log* /npm-debug.log*
/yarn-error.log /yarn-error.log
/yarn.lock
/package-lock.json
/unpackage /unpackage
.DS_Store
// php测试环境
export const php = 'http://test.pet-dbc.cn/mobile/index.php?'
// php正式环境
//export php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// go测试环境
export const go = 'https://tm.pet-dbc.cn'
// go正式环境
// export go 'https://m.pet-dbc.cn';
\ No newline at end of file
import { php } from './host.js';
export function login() {
location.href = php + 'app=member&act=login';
}
\ No newline at end of file
export default {
'contact': '\ue100',
'person': '\ue101',
'personadd': '\ue102',
'contact-filled': '\ue130',
'person-filled': '\ue131',
'personadd-filled': '\ue132',
'phone': '\ue200',
'email': '\ue201',
'chatbubble': '\ue202',
'chatboxes': '\ue203',
'phone-filled': '\ue230',
'email-filled': '\ue231',
'chatbubble-filled': '\ue232',
'chatboxes-filled': '\ue233',
'weibo': '\ue260',
'weixin': '\ue261',
'pengyouquan': '\ue262',
'chat': '\ue263',
'qq': '\ue264',
'videocam': '\ue300',
'camera': '\ue301',
'mic': '\ue302',
'location': '\ue303',
'mic-filled': '\ue332',
'speech': '\ue332',
'location-filled': '\ue333',
'micoff': '\ue360',
'image': '\ue363',
'map': '\ue364',
'compose': '\ue400',
'trash': '\ue401',
'upload': '\ue402',
'download': '\ue403',
'close': '\ue404',
'redo': '\ue405',
'undo': '\ue406',
'refresh': '\ue407',
'star': '\ue408',
'plus': '\ue409',
'minus': '\ue410',
'circle': '\ue411',
'checkbox': '\ue411',
'close-filled': '\ue434',
'clear': '\ue434',
'refresh-filled': '\ue437',
'star-filled': '\ue438',
'plus-filled': '\ue439',
'minus-filled': '\ue440',
'circle-filled': '\ue441',
'checkbox-filled': '\ue442',
'closeempty': '\ue460',
'refreshempty': '\ue461',
'reload': '\ue462',
'starhalf': '\ue463',
'spinner': '\ue464',
'spinner-cycle': '\ue465',
'search': '\ue466',
'plusempty': '\ue468',
'forward': '\ue470',
'back': '\ue471',
'left-nav': '\ue471',
'checkmarkempty': '\ue472',
'home': '\ue500',
'navigate': '\ue501',
'gear': '\ue502',
'paperplane': '\ue503',
'info': '\ue504',
'help': '\ue505',
'locked': '\ue506',
'more': '\ue507',
'flag': '\ue508',
'home-filled': '\ue530',
'gear-filled': '\ue532',
'info-filled': '\ue534',
'help-filled': '\ue535',
'more-filled': '\ue537',
'settings': '\ue560',
'list': '\ue562',
'bars': '\ue563',
'loop': '\ue565',
'paperclip': '\ue567',
'eye': '\ue568',
'arrowup': '\ue580',
'arrowdown': '\ue581',
'arrowleft': '\ue582',
'arrowright': '\ue583',
'arrowthinup': '\ue584',
'arrowthindown': '\ue585',
'arrowthinleft': '\ue586',
'arrowthinright': '\ue587',
'pulldown': '\ue588',
'closefill': '\ue589',
'sound': '\ue590',
'scan': '\ue612'
}
This diff is collapsed.
<template>
<view class="uni-pagination">
<view class="uni-pagination__btns">
<view class="uni-pagination__btn" :class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20" :hover-stay-time="70"
@click="clickLeft">
<template v-if="showIcon===true || showIcon === 'true'">
<uni-icons color="#000" size="20" type="arrowleft" />
</template>
<template v-else><text class="uni-pagination__child-btn">{{ prevText }}</text></template>
</view>
<view class="uni-pagination__btn" :class="currentIndex === maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20" :hover-stay-time="70"
@click="clickRight">
<template v-if="showIcon===true || showIcon === 'true'">
<uni-icons color="#000" size="20" type="arrowright" />
</template>
<template v-else><text class="uni-pagination__child-btn">{{ nextText }}</text></template>
</view>
</view>
<view class="uni-pagination__num">
<view class="uni-pagination__num-current">
<text class="uni-pagination__num-current-text" style="color:#007aff">{{ currentIndex }}</text><text class="uni-pagination__num-current-text">/{{ maxPage || 0 }}</text>
</view>
</view>
</view>
</template>
<script>
import uniIcons from '../uni-icons/uni-icons.vue'
export default {
name: 'UniPagination',
components: {
uniIcons
},
props: {
prevText: {
type: String,
default: '上一页'
},
nextText: {
type: String,
default: '下一页'
},
current: {
type: [Number, String],
default: 1
},
total: { // 数据总量
type: [Number, String],
default: 0
},
pageSize: { // 每页数据量
type: [Number, String],
default: 10
},
showIcon: { // 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
}
},
data() {
return {
currentIndex: 1
}
},
computed: {
maxPage() {
let maxPage = 1
let total = Number(this.total)
let pageSize = Number(this.pageSize)
if (total && pageSize) {
maxPage = Math.ceil(total / pageSize)
}
return maxPage
}
},
watch: {
current(val) {
this.currentIndex = +val
}
},
created() {
this.currentIndex = +this.current
},
methods: {
clickLeft() {
if (Number(this.currentIndex) === 1) {
return
}
this.currentIndex -= 1
this.change('prev')
},
clickRight() {
if (Number(this.currentIndex) === this.maxPage) {
return
}
this.currentIndex += 1
this.change('next')
},
change(e) {
this.$emit('change', {
type: e,
current: this.currentIndex
})
}
}
}
</script>
<style lang="scss" scoped>
.uni-pagination {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
/* #ifdef APP-NVUE */
padding: 0 20px;
/* #endif */
width: 350px;
position: relative;
left: 50%;
margin-left: -175px;
overflow: hidden;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-pagination__btns {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
justify-content: space-between;
align-items: center;
flex-direction: row;
}
.uni-pagination__btn {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
width: 60px;
height: 30px;
line-height: 30px;
font-size: $uni-font-size-base;
position: relative;
background-color: $uni-bg-color-grey;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
border-width: 1px;
border-style: solid;
border-color: $uni-border-color;
}
.uni-pagination__child-btn {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
font-size: $uni-font-size-base;
position: relative;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
}
.uni-pagination__num {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
position: absolute;
left: 150px;
top: 0;
flex-direction: row;
justify-content: center;
align-items: center;
width: 50px;
height: 30px;
line-height: 30px;
font-size: $uni-font-size-base;
color: $uni-text-color;
}
.uni-pagination__num-current {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-pagination__num-current-text {
font-size: 15px;
}
.uni-pagination--enabled {
color: #333333;
opacity: 1;
}
.uni-pagination--disabled {
opacity: 0.3;
}
.uni-pagination--hover {
color: rgba(0, 0, 0, .6);
background-color: $uni-bg-color-hover;
}
</style>
...@@ -84,9 +84,17 @@ ...@@ -84,9 +84,17 @@
"enable" : true "enable" : true
} }
}, },
"devServer" : { "devServer": {
"https" : true "port": 8080,
}, "disableHostCheck": true,
"domain" : "https://test.pet-dbc.cn" "proxy": {
"/api": {
"target": "http://192.168.50.133:6564/",
"changeOrigin": true,
"secure": false,
"pathRewrite":{"^/api":"api"}
}
}
}
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "uni-app"
} }
},
{
"path": "pages/category/Category"
},
{
"path": "pages/web/Web"
} }
], ],
"globalStyle": { "globalStyle": {
......
<template>
<view>
<view class="search_box">
<uni-icons type="back" size="30" :style="{'position':'relative','top': '-2px'}" @click.native="goBack()"></uni-icons>
<i @click="search"></i>
<input type="text" placeholder="我是要找的商品名" v-model="keyword" @confirm="search">
<view class="category_list">
<text :class="{act: tabIndex === -1}" @click="changeTabs(-1, firsr_cate_id)">全部</text>
<text v-for="(item, index) in cate_list" :key="index" :class="{act: tabIndex === index}" @click="changeTabs(index, item.cate_id)">{{item.cate_name}}</text>
</view>
</view>
<view class="goods_box">
<view class="goods_item" v-for="(item, index) in goods_list" :key="index">
<image :src="item.default_image"></image>
<view class="goods_item_info">
<p>{{item.goods_name}}</p>
<p>{{item.goods_subname}}</p>
<view class="goods_tag">
<text>限时免息</text>
<text>9个月账期</text>
</view>
<p class="price">
<text></text>{{item.price}}
</p>
</view>
<i class="cart_icon"></i>
</view>
<view class="pageBox">
<uni-pagination :total="page['total']" show-icon="true" @change="changePage"></uni-pagination>
</view>
</view>
</view>
</template>
<script>
import uniIcons from "@/components/uni-icons/uni-icons.vue";
import uniPagination from '@/components/uni-pagination/uni-pagination.vue';
export default {
data() {
return {
goods_list: [],
page: {
total: 0
},
cate_list: [],
firsr_cate_id: '',
tabIndex: -1,
params: {},
keyword: ''
}
},
onLoad(option) {
this.firsr_cate_id = option.cate_id_1;
option.current = Number(option.current);
option.pageSize = Number(option.pageSize);
this.params = option;
this.getData(option)
},
components: {
uniIcons,
uniPagination
},
methods: {
goBack() {
history.back()
},
getData(params) {
uni.request({
url: '/api/credit_goods/get_credit_second_goods',
method: 'POST',
data: params,
dataType: 'json',
success: (res) => {
const { credit_cates_list, credit_goods_list } = res.data.data,
{ page } = res.data;
this.goods_list = credit_goods_list;
this.cate_list = credit_cates_list;
this.page = page;
}
});
},
changeTabs(index, cate_id) {
if(index == -1) {
var params = {
cate_id_1: cate_id+''
};
} else {
var params = {
cate_id_2: cate_id+''
};
}
this.tabIndex = index;
uni.request({
url: '/api/credit_goods/get_credit_second_goods',
method: 'POST',
data: {
...params,
current: 1,
pageSize: 10
},
dataType: 'json',
success: (res) => {
const { credit_goods_list } = res.data.data,
{ page } = res.data;
this.goods_list = credit_goods_list;
this.page = page;
}
});
},
changePage(data) {
const { current } = data;
uni.request({
url: '/api/credit_goods/get_credit_second_goods',
method: 'POST',
data: {
...this.params,
current: current,
},
dataType: 'json',
success: (res) => {
const { credit_goods_list } = res.data.data;
this.goods_list = credit_goods_list;
}
});
},
search(keyword) {
uni.request({
url: '/api/credit_goods/get_credit_second_goods',
method: 'POST',
data: {
goods_name: this.keyword,
current: 1,
pageSize: 10
},
dataType: 'json',
success: (res) => {
const { credit_goods_list } = res.data.data,
{ page } = res.data;
this.goods_list = credit_goods_list;
this.page = page;
}
});
}
}
}
</script>
<style lang="less" scoped>
.search_box {
background: url(../../static/category/2641581405726_.pic.png) no-repeat;
background-position: 100% 100%;
i {
display: inline-block;
width: 60rpx;
height: 60rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAMAAACfWMssAAAAulBMVEUhISEiIiIjIyMsLCwtLS0vLy86OjpAQEBISEhMTExPT09SUlJaWlppaWl0dHR4eHh5eXmOjo6Tk5OYmJienp7AwMDJycnNxGbNxWjOxWjOxWrPxmvPxm7Qx3DQyHPRyXTRynbV1dXW1tbX0IrX0YvY0YvY0ozb1Zbb1pjc3Nzl5eXm4rvm4rzo6Ojp5cTp5sXq6urr6Mzr6M3s7Ozt6tLt69Xu69bv7+/w7tzx8fH19O/19e/39/X4+Phd4ycQAAABNklEQVRIx+3XyVKDQBCA4R8JEBJZBWTcIrjvUdS4zfu/lodErYhVA11lTukbFB80MNM9w/ZXHN1/6B7Bgh0/6X4xh5NbrSXw7E1L4M6V1hK496hF8OBFy6DQafQarhAWWZpmRV9YxQ4AOHHVAzahxXdYYdMV1h6AGyVJ5AJ4dTdYD4BgkWEVAIO6C2w8sPOf49wGr+kAQ7CXnlDbEJphZUG+fCoHqzLCGILf1wQQG6EDrbtX4JhgAW77fVwoDDCDqA0jyAwwhaQNE0j/C4pTFX8c8e+QDwDxkBMP8j+nlXUpm8gwnklKB8CoERSriyHgTwXlceoDwxtBQW5GgC9pAbMxbIh6x+umtbXujyuA4gXSRLokU/vCRaBSu9ciWJZlef4uhOXhnSRVpZRSp89CqNTJQ6/twycM+aPLaun/FQAAAABJRU5ErkJggg==) no-repeat;
background-size: 100% 100%;
margin-left: 20rpx;
position: relative;
top: 8rpx;
}
input {
display: inline-block;
vertical-align: middle;
width: 590rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 28rpx;
margin: 14rpx 0 40rpx 0;
background: #F8F8F8;
border-radius: 0 30rpx 30rpx 0;
}
.category_list {
display: block;
white-space: nowrap;
overflow: scroll;
width: 94.6%;
margin-left: 2.7%;
padding-bottom: 8rpx;
text {
font-size: 28rpx;
line-height: 40rpx;
margin-right: 68rpx;
}
text:last-child {
margin-right: 0;
}
text.act {
font-size: 32rpx;
line-height: 44rpx;
position: relative;
font-weight: 500;
}
text.act:after {
width: 52rpx;
height: 4rpx;
background: #212121;
position: absolute;
left: 50%;
bottom: -8rpx;
margin-left: -26rpx;
content: '';
}
}
.category_list::-webkit-scrollbar {
display: none;
}
}
.goods_box {
padding-bottom: 80rpx;
.pageBox {
text-align: center;
}
.goods_item {
position: relative;
width: 100%;
box-sizing: border-box;
padding: 32rpx 88rpx 32rpx 20rpx;
background: #fff;
display: flex;
justify-content: space-between;
.cart_icon {
position: absolute;
right: 88rpx;
bottom: 32rpx;
width: 56rpx;
height: 56rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAAAAACN7WTCAAABfElEQVRIx2P4TyZgGNU4qnFUIxEafx87+eYvORqvVFRUbiTLxstTSktW/yHHj7/2FRa9ICtw/kzM2wa2/MTmzZs2gTAEbL3yi0Co7sye/A9IfcpGBVlZU/7i1/g4o/gryObzEJtgdm4uyliDX+PXgpQn2Ly0LaUNv8Z/PYl7sGlcnTiRQMpZETsXm8aJccsJaDwTXfULU9/3ouiDBDS+j4z5jKnxU3T4IwIaf+SFXMXUeCsk+jOh3NEfuBpT4+bAwl+ENK7x68bUOMOvl2B+vOmd8h1d7F+F9xKCGj/5e75DF/sc6X6MoMbfOS7oiv6/dnF5SbjomODYhV4O7HIM+ExY4z5b+1lr1gPBurVr16xZs3rVipnetpV/CWv8XmiFAbzuElPKfd4wpb8PCPr7+yeAwMRJK14Mt5L822ZQmJ6FhOOHTSDOub/EaFwVCwYfwJxFYHbcR2I03stJTk5OgqaC6xkgTjdRNv7//R0I/sEKaWTOaI08qnHoaQQAAyi97TBEkioAAAAASUVORK5CYII=) no-repeat;
background-size: 100% 100%;
}
image {
width: 240rpx;
height: 240rpx;
margin-right: 24rpx;
}
.goods_item_info {
width: 402rpx;
position: relative;
p:nth-of-type(1) {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 30rpx;
line-height: 42rpx;
margin-bottom: 10rpx;
}
p:nth-of-type(2) {
width: 100%;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
font-size: 11rpx;
color: #7C7C7C;
}
.goods_tag {
display: block;
text {
display: inline-block;
vertical-align: middle;
border: 1px solid #C7B64E;
color: #C7B64E;
height: 36rpx;
line-height: 36rpx;
padding: 0 12rpx;
border-radius: 18rpx;
font-size: 22rpx;
margin-right: 8rpx;
}
}
.price {
font-size: 40rpx;
line-height: 40rpx;
margin-top: 26rpx;
text {
font-size: 28rpx;
}
}
}
}
}
</style>
This diff is collapsed.
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(e) {
this.url = e.url
}
}
</script>
<style>
</style>
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment