zhouzhenyuan 10 months ago
commit f5508532e3
  1. 7
      api/article/index.js
  2. 8
      api/goods/index.js
  3. 17
      api/newFun.js
  4. 2
      pages/goods/list.vue
  5. 85
      pages/news/article/add.vue
  6. 60
      pages/news/article/classify.vue
  7. 52
      pages/news/article/detail.vue
  8. 173
      pages/news/article/index.vue
  9. 19
      pages/news/park/browsingHistory.vue
  10. 3
      pages/user/index.vue

@ -3,7 +3,12 @@ import request from '@/utils/request'
// api地址
const api = {
list: 'article/list',
detail: 'article/detail'
detail: 'article/detail',
del: 'article/del'
}
// 文章列表
export function del(param, option) {
return request.post(api.del, param, option)
}
// 文章列表

@ -1,7 +1,8 @@
import request from '@/utils/request'
// api地址
const api = {
const api = {
browseHistory: 'cart/list',
list: 'goods/list',
detail: 'goods/detail',
basic: 'goods/basic',
@ -10,6 +11,11 @@ const api = {
recommended: 'goods/recommended',
poster: 'goods/poster'
}
// 商品浏览记录
export const browseHistory = (param, option) => {
return request.get(api.browseHistory, param, option)
}
// 商品列表
export const list = (param, option) => {

@ -0,0 +1,17 @@
import request from '@/utils/request'
// api地址
const api = {
list: 'shop/list',
detail: 'shop/detail'
}
// 自提门店列表
export const inviteList = (param) => {
return request.get(api.list, param)
}
// 门店详情
export const detail = (shopId) => {
return request.get(api.detail, { shopId })
}

@ -129,7 +129,7 @@
<script>
import WxofficialMixin from '@/core/mixins/wxofficial'
import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins'
import * as GoodsApi from '@/api/goods'
import * as GoodsApi from '@/api/goods'
import {
getEmptyPaginateObj,
getMoreListData

@ -4,13 +4,13 @@
<view class="item">
<view class="a">文章标题<text>*</text></view>
<view class="b">
<input placeholder="请输入分类名称" type="text"/>
<input v-model="detail.title" placeholder="请输入分类名称" type="text"/>
</view>
</view>
<view class="item">
<view class="a">文章分类<text>*</text></view>
<view class="b">
<view class="select">请选择分类名称<u-icon name="arrow-right"></u-icon></view>
<view class="b" @click="openPage(1)">
<view class="select" :class="tabMIndex>= 0?'select-on':''">{{tabMIndex>=0? list[tabMIndex].name:'请输入分类名称'}}<u-icon name="arrow-right"></u-icon></view>
</view>
</view>
<view class="items">
@ -37,15 +37,14 @@
</view>
</view>
<view class="goods-fd">
<view class="btn">保存</view>
<view class="btn" @click="toSubmit()">保存</view>
</view>
<u-popup v-model="isShow" mode="bottom" border-radius="12" mask-close-able="false" closeable>
<view class="goods-classify">
<view class="goods-classify-hd">
<view class="a" @click="openPage(4)"><u-icon name="plus"></u-icon></view></view>
<view class="goods-classify-hd">商品分类</view>
<view class="goods-classify-bd">
<scroll-view scroll-y class="m">
<view class="item" v-for="(a,i) in 10" @click="tabMItem(i)"><view :class="tabMIndex == i?'item-on':''">物流</view></view>
<view class="item" v-for="(a,i) in list" @click="tabMItem(i)"><view :class="tabMIndex == i?'item-on':''">{{a.name}}</view></view>
</scroll-view>
</view>
</view>
@ -53,7 +52,9 @@
</view>
</template>
<script>
<script>
import * as ArticleApi from '@/api/article'
import * as CategoryApi from '@/api/article/category'
export default {
data() {
return {
@ -62,19 +63,44 @@
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
detail: {},
formats: {},
isShow: true,
isShow: false,
checked: false,
value: "",
popupType: 1,
tabLIndex: 0,
tabRIndex: 0,
tabMIndex: 0,
tabMIndex1: 0
tabMIndex: -1,
type: -1,
id: ''
};
},
onLoad(o) {
this.getCategoryList();
this.id = o.article_id;
this.type = o.type;
if(this.id){
this.getArticleDetail();
}
},
methods: {
//
async getArticleDetail() {
const {status, message, data} = await ArticleApi.detail(this.articleId);
if(status == 200){
this.detail = data.detail
}
}
//
async getCategoryList(categoryId) {
const {status, message, data} = await CategoryApi.list();
if(status == 200){
this.list = data.list;
}
},
//
async toSubmit(){
},
onStatusChange(e) {
const formats = e.detail
this.formats = formats
@ -85,30 +111,17 @@
}).exec()
},
openPage(i){
if(i<= 3){
if(i == 1){
this.isShow = true;
this.popupType=i
}else if(i == 4){
uni.navigateTo({
url: "/pages/news/goods/classification"
})
}
},
tabLItem(i){
this.tabLIndex = i
console.log(this.tabLIndex)
},
tabRItem(i){
this.tabRIndex = i
console.log(this.tabRIndex)
},
tabMItem(i){
this.tabMIndex = i
console.log(this.tabMIndex)
},
tabMItem1(i){
this.tabMIndex1 = i
console.log(this.tabMIndex1)
tabMItem(index) {
this.tabMIndex = index;
this.isShow = false;
},
}
}
@ -117,18 +130,15 @@
<style lang="scss" scoped>
.goods{
.ql-container {
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 100%;
font-size: 16px;
line-height: 1.5;
color: #212121;
font-size: 26rpx;
overflow: auto;
padding: 10px 10px 20px 10px;
padding: 10rpx 10rpx 20rpx 10rpx;
border: 1px solid #ECECEC;
}
padding: 0 0 130rpx;
@ -318,6 +328,7 @@
line-height: 70rpx;
padding-left: 30rpx;
box-sizing: border-box;
text-align: left;
&-on{
background-color: #fff;
font-weight: 500;

@ -3,8 +3,9 @@
<view class="goods-hd">
<view class="item">
<view class="a">分类名称</view>
<view class="b" @click="openPage(1)">
<view class="select">请输入分类名称<u-icon name="arrow-right"></u-icon></view>
<view class="b">
<input :value="name" type="text" placeholder="请输入分类名称"><u-icon name="arrow-right"></u-icon>
<!-- <view @click="openPage(1)" class="select" :class="tabMIndex>= 0?'select-on':''">{{tabMIndex>=0? list[tabMIndex].name:'请输入分类名称'}}<u-icon name="arrow-right"></u-icon></view> -->
</view>
</view>
<view class="items">
@ -14,62 +15,36 @@
</view>
</view>
<view class="items">
<view class="a">排序<text>*</text><view class="input"><input type="text" placeholder="数字越小越靠前"/></view></view>
<view class="a">排序<text>*</text><view class="input"><input :value="sort" type="text" placeholder="数字越小越靠前"/></view></view>
<view class="d">1</view>
</view>
</view>
<view class="goods-fd">
<view class="btn">确认</view>
<view class="btn" @click="toSubmit()">确认</view>
</view>
</view>
</template>
<script>
<script>
import * as CategoryApi from '@/api/article/category'
export default {
data() {
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
isShow: false,
checked: false,
value: "",
popupType: 1,
tabLIndex: 0,
tabRIndex: 0,
tabMIndex: 0,
tabMIndex1: 0
sort: "",
name: "",
tabMIndex: -1,
list: [],
checked: true
};
},
methods: {
openPage(i){
if(i<= 3){
this.isShow = true;
this.popupType=i
}else if(i == 4){
uni.navigateTo({
url: "/pages/news/goods/classification"
})
}
},
tabLItem(i){
this.tabLIndex = i
console.log(this.tabLIndex)
},
tabRItem(i){
this.tabRIndex = i
console.log(this.tabRIndex)
},
tabMItem(i){
this.tabMIndex = i
console.log(this.tabMIndex)
},
tabMItem1(i){
this.tabMIndex1 = i
console.log(this.tabMIndex1)
//
async toSubmit(){
await
},
}
}
</script>
@ -283,6 +258,7 @@
white-space: nowrap;
line-height: 70rpx;
padding-left: 80rpx;
text-align: left;
box-sizing: border-box;
&-on{
color: #FF624F;

@ -1,20 +1,60 @@
<template>
<view class="article">
<view class="title">荣耀畅玩 40 Plus 全网通5G版 绿8GB+128GB</view>
<view class="desc">2024-01-08 14:30:40</view>
<view class="content">荣耀畅玩 40 Plus 全网通5G版 绿8GB+128GB</view>
<view class="title">{{detail.title}}</view>
<view class="desc">{{detail.createTime}}</view>
<view class="content" v-html="detail.content"></view>
</view>
</template>
<script>
import * as ArticleApi from '@/api/article'
export default {
data() {
return {
return {
// ID
articleId: null,
//
detail: {}
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// ID
this.articleId = options.articleId
//
this.getArticleDetail()
},
methods: {
//
async getArticleDetail() {
const {status, message, data} = await ArticleApi.detail(this.articleId);
if(status == 200){
this.detail = data.detail
}
}
},
/**
* 分享当前页面
*/
onShareAppMessage() {
return {
title: this.detail.title,
path: "/pages/news/article/detail?articleId=" + this.articleId
}
},
/**
* 分享到朋友圈
* 本接口为 Beta 版本暂只在 Android 平台支持详见分享到朋友圈 (Beta)
* https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
*/
onShareTimeline() {
return {
title: this.detail.title,
path: "/pages/news/article/detail?articleId=" + this.articleId
}
}
}
</script>

@ -1,41 +1,43 @@
<template>
<view class="article">
<template>
<view class="article">
<view class="article-hd">
<view class="search">
<view class="box">
<image src="/static/news/icon-search.png"></image>
<input type="search" placeholder="商品名称/编码" />
<image src="/static/news/icon-search.png" @click="getArticleList()"></image>
<input :value="keyword" type="search" placeholder="商品名称/编码" />
</view>
<view class="add">
<view class="add" @click="toDetail(2)">
<image src="/static/news/icon-add.png"></image>新增
</view>
</view>
<u-tabs :list="list" :is-scroll="false" v-model="current" active-color="#FF2525" inactive-color="#6F6F6F" font-size="30" ></u-tabs>
<u-tabs :list="list" :is-scroll="false" v-model="current" @change="changeTab" active-color="#FF2525" inactive-color="#6F6F6F" font-size="30" ></u-tabs>
</view>
<view class="article-bd">
<u-swipe-action class="b" v-for="k in 5" :key="i" @click="clickItem(11)" :options="options">
<u-swipe-action class="b" v-for="(a,i) in articleList" :index="i" @open="open" :key="i" @click="clickItem" :options="options">
<view class="item u-border-bottom">
<view class="pic">
<image mode="aspectFill" src="@/static/home/phone.jpg" />
<view class="pic" @click.stop="toDetail(1,a)">
<image mode="aspectFill" :src="a.image_url" />
</view>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="info title-wrap">
<view class="title">荣耀畅玩 40 Plus 全网通5G版 绿8GB+128GB</view>
<view class="desc">
这是文章内容这是文章内容这是文章内容这是文章内容这是文章..
</view>
<view class="info title-wrap" @click.stop="toDetail(1,a)">
<view class="title">{{a.title}}</view>
<view class="desc" v-html="a.content"></view>
</view>
</view>
</u-swipe-action>
</view>
</view>
<u-empty text="暂无信息" v-if="total == 0" mode="list"></u-empty>
</view>
</template>
<script>
import * as ArticleApi from '@/api/article'
import * as CategoryApi from '@/api/article/category'
export default {
data() {
return {
keyword: "",
isShow: false,
options: [
{
text: '编辑',
@ -49,33 +51,124 @@
backgroundColor: '#FF564A'
}
}
],
list: [{
name: '全部'
}, {
name: '分类1'
}, {
name: '分类2'
}, {
name: '分类3'
}, {
name: '分类4'
}, {
name: '分类5'
}, {
name: '分类6'
}],
current: 1
],
articleList: [],
list: [],
total: 1,
pageNum: 1,
current: 0
};
},
onReady() {
this.getCategoryList();
},
onReachBottom() {
if(this.articleList.length <= this.total){
uni.showLoading({
title:"加载中"
})
this.pageNum ++;
this.getArticleList();
}
},
methods: {
toDetail(index,a){
if(index == 1){
uni.navigateTo({
url: "/pages/news/article/detail?articleId="+a.article_id
})
}else if(index == 2){
uni.navigateTo({
url: "/pages/news/article/add?type=1"
})
}
},
changeTab(i){
uni.showLoading({
title:"加载中"
})
this.current = i
this.pageNum = 1;
this.articleList = []
this.getArticleList();
},
async toDel(index,article_id){
const {status, message, data} = await CategoryApi.del({
article_id
});
if(status == 200){
uni.showToast({
title: "删除成功"
})
this.articleList.splice(index, 1);
}
},
//
async getCategoryList(categoryId) {
const {status, message, data} = await CategoryApi.list();
if(status == 200){
this.list = data.list;
this.getArticleList();
}
},
/**
* 获取文章列表
*/
async getArticleList() {
let {status, message, data} = await ArticleApi.list({
categoryId: this.list[this.current].category_id,
page: this.pageNum,
keyword: this.keyword
});
if(status == 200){
uni.hideLoading();
if(data.list.data && data.list.data.length > 0){
data.list.data.map(a=>{
a.show = false
})
}
this.articleList = this.articleList.concat(data.list.data)
this.total = data.list.total
}
},
clickItem(index, index1){
console.log(index)
if(index1 == 0){
uni.navigateTo({
url: "/pages/news/article/add?type=2&articleId="+this.articleList[index].article_id
})
}else{
uni.showModal({
title: "温馨提示",
content: "确定要删除该信息?",
confirmColor: "#FF584D",
complete(res) {
if(res.confirm){
this.toDel(index,this.articleList[index].category_id);
}
// if(res.CategoryApi)
}
})
}
},
//
open(index) {
// swipeActionprops
// 'false''false'
this.list[index].show = true;
this.list.map((val, idx) => {
if(index != idx) this.list[idx].show = false;
})
}
}
}
</script>
<style lang="scss">
.article{
&-bd{
.uni-movable-area{
background-color: transparent !important;
}
.uni-movable-area{
background-color: transparent !important;
}
}
}
</style>
@ -157,6 +250,14 @@
font-weight: 500;
color: #3B3B3B;
}
.desc{
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
}
}

@ -1,14 +1,14 @@
<template>
<view class="browsing">
<view class="browsing-hd">
<view class="do">操作</view>
<view class="do">{{isToggle?'操作':'编辑'}}</view>
</view>
<view class="browsing-bd">
<view class="li" v-for="i in 2" :key="i">
<view class="a">今天</view>
<u-swipe-action class="b" v-for="k in 5" :key="i" @click="clickItem(11)" :options="options">
<view class="item u-border-bottom">
<view class="select">
<view class="select" v-if="isToggle">
<image mode="aspectFill" v-if="true" src="@/static/invoice/select.png" />
<image mode="aspectFill" v-else src="@/static/invoice/select-on.png" />
</view>
@ -41,10 +41,12 @@
</view>
</template>
<script>
<script>
import * as GoodsApi from '@/api/goods'
export default {
data() {
return {
isToggle: false,
options: [
{
text: '删除',
@ -56,7 +58,18 @@
timestamp: 24*3600*1000,
};
},
onReady() {
this.getBrowseHistoryList();
},
methods: {
/**
* 获取浏览记录列表
*/
async getBrowseHistoryList(pageNo = 1) {
const app = this
const {} = await GoodsApi.browseHistory({})
},
clickItem(e){
console.log(e)
}

@ -87,7 +87,7 @@
src="https://lanhu.oss-cn-beijing.aliyuncs.com/FigmaDDSSlicePNG734520a67fe8e1d927b6d6e351bd2ade.png"
class="thumbnail_4"></image>
</view>
<view class="grounding">
<view class="grounding" v-if="userInfo.user_type==1">
<view class="image-text_2">
<image src="/static/user/shelf.png" class="label_1"></image>
<view class="text-group_2">
@ -477,6 +477,7 @@
//
onRefreshPage() {
this.isLogin = checkLogin()
console.log(this.isLogin,'是否登录')
//
this.getUserInfo()
},

Loading…
Cancel
Save