文章接口

dev
shuxiaoquan 1 year ago
parent 26d52368a2
commit 462f92c7c7
  1. 25
      api/article/index.js
  2. 7
      api/goods/index.js
  3. 14
      api/newFun.js
  4. 3
      pages.json
  5. 75
      pages/news/article/add.vue
  6. 20
      pages/news/article/index.vue
  7. 34
      pages/news/park/browsingHistory.vue
  8. 8
      pages/news/recycling/detail.vue
  9. 55
      pages/news/recycling/pay.vue
  10. 21
      pages/serve/index.vue
  11. 39
      pages/user/index.vue

@ -4,9 +4,30 @@ import request from '@/utils/request'
const api = {
list: 'article/list',
detail: 'article/detail',
del: 'article/del'
del: 'storeKeeper/articleDelete',
edit: 'storeKeeper/articleEdit',
add: 'storeKeeper/articleAdd',
articleCatList: 'article.category/list',
articleCatAdd: 'storeKeeper/articleCatAdd',
articleCatDelete: 'storeKeeper/articleCatDelete',
articleCatEdit: 'storeKeeper/articleCatEdit'
}
// 文章列表
// 文章分类列表
export function articleCatList(param, option) {
return request.get(api.articleCatList, param, option)
}
// 文章 编辑
export function edit(param, option) {
return request.post(api.edit, param, option)
}
// 文章 新增
export function add(param, option) {
return request.post(api.add, param, option)
}
// 文章 删除
export function del(param, option) {
return request.post(api.del, param, option)
}

@ -2,7 +2,7 @@ import request from '@/utils/request'
// api地址
const api = {
browseHistory: 'cart/list',
browseHistoryList: 'goods/browseLog',
list: 'goods/list',
detail: 'goods/detail',
basic: 'goods/basic',
@ -14,9 +14,10 @@ const api = {
}
// 商品浏览记录
export const browseHistory = (param, option) => {
return request.get(api.browseHistory, param, option)
export const browseHistoryList = (param, option) => {
return request.get('goods/browseLog', param, option)
}
// 商品浏览记录
export const serveList = (param, option) => {
return request.get(api.serveList, param, option)

@ -1,9 +1,15 @@
import request from '@/utils/request'
// // 上门回收 门店列表
// export const storeList = (param) => {
// return request.get('upload/image', param)
// }
// 足迹列表 删除
export const goodsBrowseDel = (param) => {
return request.get('goods/browseDel', param)
}
// 足迹列表
export const goodsBrowseLog = (param) => {
return request.get('goods/browseLog', param)
}
// 上门回收 门店列表
export const storeList = (param) => {
return request.get('shop/list', param)

@ -769,8 +769,7 @@
{
"path": "recycling/detail",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"navigationBarTitleText": "详情页",
"enablePullDownRefresh": false
}
},

@ -4,7 +4,7 @@
<view class="item">
<view class="a">文章标题<text>*</text></view>
<view class="b">
<input v-model="detail.title" placeholder="请输入分类名称" type="text"/>
<input v-model="detail.title" placeholder="请输入文章标题" type="text"/>
</view>
</view>
<view class="item">
@ -16,12 +16,11 @@
<view class="items">
<view class="a">封面图片<text>*</text></view>
<view class="c">
<u-upload :action="action" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="8">
<u-upload :action="action" :header="header" @on-uploaded="success" width="180" height="180" :file-list="fileList" :custom-btn="true" max-count="1">
<template v-slot:addBtn>
<view class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="/static/news/icon-upload.png"></image>
<view class="1">上传图片</view>
<view class="l">1/8</view>
</view>
</template>
</u-upload>
@ -53,16 +52,14 @@
</template>
<script>
import Config from '@/core/config'
import * as ArticleApi from '@/api/article'
import * as CategoryApi from '@/api/article/category'
export default {
data() {
return {
fileList: [
{
url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
}
],
action: "",
fileList: [],
detail: {},
formats: {},
isShow: false,
@ -78,11 +75,26 @@
this.getCategoryList();
this.id = o.article_id;
this.type = o.type;
uni.setNavigationBarTitle({
title: !this.id?'新增文章':'编辑文章'
})
if(this.id){
this.getArticleDetail();
}
},
onReady() {
this.action = (Config.get('apiUrl')+'user/image').replace("index.php?s=/","")
this.header = {
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
'AccessToken': uni.getStorageSync('AccessToken'),
'platform': "MP-WEIXIN",
}
},
methods: {
success(a,b) {
console.log(a)
console.log(b)
},
//
async getArticleDetail() {
const {status, message, data} = await ArticleApi.detail(this.articleId);
@ -99,7 +111,34 @@
},
//
async toSubmit(){
if(!this.detail.title){
uni.showToast({
icon: "none",
title: "文章标题不能为空!"
})
return ;
}
if(!this.detail.category_id){
uni.showToast({
icon: "none",
title: "请选择分类!"
})
return ;
}
if(!this.detail.image_id){
uni.showToast({
icon: "none",
title: "请上传封面!"
})
return ;
}
if(!this.detail.content){
uni.showToast({
icon: "none",
title: "文章内容不能为空!"
})
return ;
}
},
onStatusChange(e) {
const formats = e.detail
@ -130,16 +169,13 @@
<style lang="scss" scoped>
.goods{
.ql-container {
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 100%;
color: #212121;
font-size: 26rpx;
overflow: auto;
padding: 10rpx 10rpx 20rpx 10rpx;
border: 1px solid #ECECEC;
box-sizing: border-box;
width: 100%;
color: #212121;
font-size: 26rpx;
overflow: auto;
padding: 10rpx 10rpx 20rpx 10rpx;
border: 1px solid #ECECEC;
}
padding: 0 0 130rpx;
overflow: hidden;
@ -285,6 +321,7 @@
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
margin: 0 auto;
}
}
&-classify{

@ -3,8 +3,8 @@
<view class="article-hd">
<view class="search">
<view class="box">
<image src="/static/news/icon-search.png" @click="getArticleList()"></image>
<input :value="keyword" type="search" placeholder="商品名称/编码" />
<image src="/static/news/icon-search.png" @click="getArticleList(1)"></image>
<input v-model="keyword" type="search" placeholder="请输入文章标题" />
</view>
<view class="add" @click="toDetail(2)">
<image src="/static/news/icon-add.png"></image>新增
@ -31,8 +31,7 @@
</template>
<script>
import * as ArticleApi from '@/api/article'
import * as CategoryApi from '@/api/article/category'
import * as ArticleApi from '@/api/article'
export default {
data() {
return {
@ -93,7 +92,7 @@
this.getArticleList();
},
async toDel(index,article_id){
const {status, message, data} = await CategoryApi.del({
const {status, message, data} = await ArticleApi.del({
article_id
});
if(status == 200){
@ -105,7 +104,7 @@
},
//
async getCategoryList(categoryId) {
const {status, message, data} = await CategoryApi.list();
const {status, message, data} = await ArticleApi.articleCatList();
if(status == 200){
this.list = data.list;
this.getArticleList();
@ -114,11 +113,15 @@
/**
* 获取文章列表
*/
async getArticleList() {
async getArticleList(type) {
if(type == 1){
this.pageNum = 1;
this.articleList = []
}
let {status, message, data} = await ArticleApi.list({
categoryId: this.list[this.current].category_id,
page: this.pageNum,
keyword: this.keyword
title: this.keyword
});
if(status == 200){
uni.hideLoading();
@ -129,6 +132,7 @@
}
this.articleList = this.articleList.concat(data.list.data)
this.total = data.list.total
console.log(this.articleList)
}
},
clickItem(index, index1){

@ -6,7 +6,7 @@
<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">
<u-swipe-action class="b" v-for="k in 5" :key="i" @click="clickItem(i)" :options="options">
<view class="item u-border-bottom">
<view class="select" v-if="isToggle">
<image mode="aspectFill" v-if="true" src="@/static/invoice/select.png" />
@ -29,6 +29,7 @@
</view>
</u-swipe-action>
</view>
<u-empty text="暂无信息" v-if="total == 0" mode="list"></u-empty>
</view>
<view class="browsing-fd">
<view class="a">
@ -47,6 +48,9 @@
data() {
return {
isToggle: false,
list: [],
total: 1,
pageNum: 1,
options: [
{
text: '删除',
@ -55,23 +59,36 @@
}
}
],
timestamp: 24*3600*1000,
};
},
onReady() {
this.getBrowseHistoryList();
},
onReachBottom() {
if(this.list.length <= this.total){
uni.showLoading({
title:"加载中"
})
this.pageNum ++;
this.getBrowseHistoryList();
}
},
methods: {
/**
* 获取浏览记录列表
*/
async getBrowseHistoryList(pageNo = 1) {
const app = this
const {} = await GoodsApi.browseHistory({})
async getBrowseHistoryList() {
const {status, data} = await GoodsApi.browseHistoryList({
page: this.pageNum
})
if(status == 200){
uni.hideLoading();
this.list = this.list.concat(data.list.data)
this.total = data.list.total
}
},
clickItem(e){
console.log(e)
clickItem(idx,index){
console.log(idx,index)
}
}
}
@ -145,6 +162,7 @@
font-size: 32rpx;
font-weight: 500;
color: #303030;
padding-top: 20rpx;
}
.item{
padding: 25rpx 0;

@ -127,7 +127,7 @@
},
onShow() {
if(uni.getStorageSync("token")){
if(uni.getStorageSync("AccessToken")){
this.getList()
}
},
@ -145,7 +145,7 @@
if(index == 2){
this.isShow = true;
}else if(index == 3){
if(!uni.getStorageSync("token")){
if(!uni.getStorageSync("AccessToken")){
uni.navigateTo({
url: "/pages/login/index"
})
@ -155,7 +155,7 @@
url: "/pages/news/recycling/confirm?tabIndex="+this.tabIndex+"&id="+this.info.server_id+"&type="+this.type
})
}else if(index == 5){
if(!uni.getStorageSync("token")){
if(!uni.getStorageSync("AccessToken")){
uni.navigateTo({
url: "/pages/login/index"
})
@ -174,7 +174,7 @@
}
}else if(index == 4){
if(!uni.getStorageSync("token")){
if(!uni.getStorageSync("AccessToken")){
uni.navigateTo({
url: "/pages/login/index"
})

@ -17,6 +17,7 @@
</template>
<script>
import { Wechat } from '@/core/payment'
import * as newFunApi from '@/api/newFun'
export default {
data() {
@ -53,10 +54,7 @@
})
}
}else if(this.list2[this.tabIndex].method == "wechat"){
uni.showToast({
icon: "none",
title: "暂无开通微信支付"
})
this.toPay1()
}
},
//
@ -80,6 +78,55 @@
})
}
},
async toPay1() {
const that = this;
const {status, data } = await newFunApi.serverOrderPay({
order_id: this.order_id,
method: 'wechat',
client: "MP-WEIXIN",
})
if(status == 200) {
Wechat.payment(data.payment)
.then((result) => {
console.log(22,result)
uni.showToast({
title: "支付成功"
})
this.isClick = true;
setTimeout(()=>{
if(that.type == 'fuwu'){
uni.redirectTo({
url: "/pages/news/recycling/orderList"
})
}else if(that.type == 'fuwuorder'){
uni.navigateBack({
delta:1
})
}
},1000)
})
.catch(err => {
uni.showToast({
title: "支付失败"
})
this.isClick = true;
setTimeout(()=>{
if(that.type == 'fuwu'){
uni.redirectTo({
url: "/pages/news/recycling/orderList"
})
}else if(that.type == 'fuwuorder'){
uni.navigateBack({
delta:1
})
}
},1000)
})
}
},
//
async toPay() {
const that = this;

@ -41,7 +41,7 @@
<text class="listText">支付订单</text>
<text class="listText">服务评价</text>
</view>
<view class="member" @click="goMember">
<view class="member" @click="goMember" v-if="userInfo.grade_id == 0">
<view class="memberCenter">
会员中心
</view>
@ -50,7 +50,7 @@
</view>
<view class="opera">
<text class="price"><text class="number">99</text></text>
<view class="operaBtn">
<view class="operaBtn" @click="openPage1()">
立即开通
</view>
</view>
@ -64,13 +64,28 @@
export default{
data (){
return{
list: []
list: [],
userInfo: {}
}
},
mounted() {
this.getList();
},
onShow() {
this.userInfo = uni.getStorageSync("userInfo")?uni.getStorageSync("userInfo"):{}
},
methods:{
openPage1(){
if(!uni.getStorageSync("AccessToken")){
uni.navigateTo({
url: "/pages/login/index"
})
return ;
}
uni.navigateTo({
url: "/pages/member/index"
})
},
openPage(a){
uni.navigateTo({
url: "/pages/activity/intimate?index="+a

@ -134,7 +134,7 @@
预约记录
</view>
</view>
<view class="listItem">
<view class="listItem" @click="toLiulang()">
<view class="num">
2
</view>
@ -459,7 +459,6 @@
</view>
</template>
<script>
import img from "@/static/member/head.png"
import {
checkLogin
} from '@/core/app'
@ -469,7 +468,7 @@
data() {
return {
background: {
background: 'url(' + img + ') center top no-repeat',
background: 'url(https://www.saas.njrenzhou.com/static/news/login-bg.png) center top no-repeat',
backgroundSize: '100% auto',
},
userType: 2,
@ -524,8 +523,19 @@
})
})
},
toLiulang() {
if (!uni.getStorageSync('AccessToken')) {
uni.navigateTo({
url: "/pages/login/index"
})
return;
}
uni.navigateTo({
url: "/pages/news/park/browsingHistory"
})
},
toFuwu(type) {
if (!uni.getStorageSync('token')) {
if (!uni.getStorageSync('AccessToken')) {
uni.navigateTo({
url: "/pages/login/index"
})
@ -601,13 +611,10 @@
.section_1 {
position: relative;
width: 902rpx;
background: url('@/static/member/head.png') center -44px no-repeat;
background-size: 100% auto;
width: 100%;
display: flex;
flex-direction: column;
margin: -26rpx 0 0 -60rpx;
background: url('https://www.saas.njrenzhou.com/static/member/head.png') center -44px no-repeat;
background: url('https://www.saas.njrenzhou.com/static/news/login-bg.png') center -80px no-repeat;
background-size: 100% auto;
}
@ -617,7 +624,7 @@
height: 114rpx;
flex-direction: row;
display: flex;
margin: 50rpx 0 0 108rpx;
margin: 50rpx auto 0;
}
.image_2 {
@ -860,7 +867,7 @@
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 16rpx 0 0 92rpx;
margin: 16rpx auto 0;
.walletList {
display: flex;
@ -893,7 +900,7 @@
.newplus {
display: flex;
margin: 16rpx 0 0 92rpx;
margin: 16rpx auto 0;
.memVip {
width: 334rpx;
@ -965,7 +972,7 @@
width: 688rpx;
display: flex;
flex-direction: column;
margin: 16rpx 0 0 92rpx;
margin: 16rpx auto 0;
.manageTitle {
width: 638rpx;
@ -1240,7 +1247,7 @@
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 16rpx 0 0 92rpx;
margin: 16rpx auto 0;
.myWallet {
height: 40rpx;
@ -1287,7 +1294,7 @@
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
opacity: 1;
margin: 16rpx 0 0 92rpx;
margin: 16rpx auto 0;
.myservice {
margin: 20rpx 0 0 30rpx;
@ -1368,7 +1375,7 @@
}
.goodsList {
margin: 0 0 0 72rpx;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
width: 100%;

Loading…
Cancel
Save