This commit is contained in:
mkm 2023-05-22 09:42:01 +08:00
parent 72162b0759
commit e5a37372b8
7 changed files with 2455 additions and 1803 deletions

View File

@ -18,6 +18,9 @@ export function getProductSpuAPI(id) {
export function get_cloud_shop(street_code) {
return request.get(`city/get_cloud_shop?street_code=${street_code}`, {}, { noAuth: true });
}
export function post_product_import(id) {
return request.post(`micro/product_import`,{ id: id }, { noAuth: true });
}
/**
* 公共接口 优惠券接口 , 行业此讯 , 手机号码注册
*

View File

@ -1,7 +1,7 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/home/index",
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
@ -95,23 +95,7 @@
}
],
"subPackages": [{
"root": "pages/index",
"name": "index",
"pages": [{
"path": "index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
// #ifdef APP-PLUS
"enablePullDownRefresh": true,
// #endif
"app-plus": {
"scrollIndicator": false //
}
}
}]
},
"subPackages": [
{
"root": "pages/goods_cate",
"name": "goods_cate",
@ -905,13 +889,6 @@
"navigationBarTitleText": "商户基本设置",
"enablePullDownRefresh": false
}
}, {
"path": "addGoods/addMyStore",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
},
@ -1289,7 +1266,7 @@
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/home/index",
"pagePath": "pages/index/index",
"iconPath": "static/tabbar_icon/a.png",
"selectedIconPath": "static/tabbar_icon/a-a.png",
"text": "泸州"

File diff suppressed because it is too large Load Diff

1757
pages/index/index_two.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,20 +9,28 @@
</block>
</view>
<view class="goods-wrapper wrapper" v-if="goods.length">
<block v-for="(item,index) in goods" :key="index">
<view class="item">
<view class="l_cont">
<image :src="item.image" mode="aspectFill"></image>
</view>
<view class="r_cont">
<text>{{item.store_name}}</text>
<view class="addBtn" @click="addGoods(item)">加入仓库</view>
</view>
</view>
</block>
</view>
<view class="list-box animated listA" :class="goods.length > 0 ? 'fadeIn on' : ''">
<view class="item" v-for="(item, index) in goods" :key="index" @click="addGoods(item)">
<view class="pictrue" :class="'cont'+conStyle">
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
</view>
<view class="text-info" style="display: flex; flex-direction: column; justify-content: space-between;">
<view>
<view class="title">{{ item.store_name }}</view>
<view class="merchant_info">
<view v-if="item.merchant && item.merchant.type_name" :style="'background:'+labelColor" class="font-bg-red">{{item.merchant.type_name}}</view>
</view>
</view>
<view class="price acea-row" :style="'color:'+priceColor">
<view>
¥
<text>{{ item.price }}</text>
</view>
<view style="padding-left: 180rpx;font-size: 34rpx;font-weight: 550" >加入仓库</view>
</view>
</view>
</view>
</view>
<u-popup :show="editGoodsShow" @close="editGoodsClose" :round="18" mode="center">
<view class="edit_goods_box">
<view class="edit_name flex_a_c edit_name_no">
@ -45,7 +53,7 @@
</view>
</view>
</u-popup>
<u-modal :show="addGoodsShow" content='是否添加到你的仓库中?' @cancel="addGoodsclose()" @close="addGoodsclose()" @confirm="addGoodsopen()" :closeOnClickOverlay="true" :showCancelButton="true"></u-modal>
<u-popup :show="searchGoodsShow" @close="searchGoodsClose" :round="18" mode="center">
<view class="search_goods_box">
<input type="text" v-model="searchGoodsName" class="searchGoods" placeholder="请输入商品名称">
@ -64,7 +72,7 @@
<script>
import { productCreate } from '@/api/product.js'
import { microSeachBarCode, microEadtProduct } from '@/api/store.js'
import { seachBarCodeAPI } from '@/api/api.js'
import { seachBarCodeAPI,post_product_import } from '@/api/api.js'
import { Toast } from '@/libs/uniApi'
export default {
data() {
@ -86,23 +94,37 @@
editGoodsPrice: '',
editGoodsStore: '',
editGoodsShow: false, //
mer_id: 318,
mer_id: 0,
searchGoodsShow: false,
searchGoodsName: '摩托',
goods: []
searchGoodsName: '',
goods: [],
item:[],
addGoodsShow:false
}
},
onLoad(e) {
this.mer_id = e.mer_id
this.searchGoodsClose()
},
onShow() {},
methods: {
addGoods(item) {
uni.navigateTo({
url: `/pages/product/addGoods/addMyStore?mer_id=${this.mer_id}&product_id=${item.product_id}`
})
this.addGoodsShow=true
this.item=item
},
addGoodsopen(){
if(this.item){
post_product_import(this.item.product_id).then(e=>{
if(e.status==200){
Toast(e.data.msg)
this.addGoodsShow=false
}
})
}
this.item=[]
},
addGoodsclose(){
this.addGoodsShow=false
},
openSearch() {},
async searchGoodsClose() {
const rq = {
@ -110,6 +132,9 @@
name: this.searchGoodsName
}
const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err))
if(data.list.length ==0){
Toast("暂无搜索商品")
}
this.goods = data.list
this.searchGoodsShow = false
},
@ -282,4 +307,283 @@
}
}
}
.list-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 20rpx 28rpx 0;
.item {
width: 328rpx;
margin-bottom: 20rpx;
overflow: hidden;
position: relative;
&.on {
border-radius: 0;
}
.pictrue_log {
width: 92rpx;
height: 44rpx;
font-size: 26rpx;
line-height: 44rpx;
}
.pictrue,/deep/image,/deep/.easy-loadimage,/deep/uni-image {
width: 100%;
display: block;
position: relative;
.border-picture {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: center/cover no-repeat;
}
}
.picture1,/deep/.picture1 image,/deep/.picture1 .easy-loadimage,/deep/.picture1 uni-image {
height: 346rpx;
position: relative;
.border-picture {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: center/cover no-repeat;
}
.sell_out {
display: flex;
width: 150rpx;
height: 150rpx;
align-items: center;
justify-content: center;
border-radius: 100%;
background: rgba(0,0,0,.6);
color: #fff;
font-size: 30rpx;
position: absolute;
top: 50%;
left: 50%;
margin: -75rpx 0 0 -75rpx;
&::before{
content: "";
display: block;
width: 140rpx;
height: 140rpx;
border-radius: 100%;
border: 1px dashed #fff;
position: absolute;
top: 5rpx;
left: 5rpx;
}
}
}
.cont1,/deep/.cont1 image,/deep/.cont1 .easy-loadimage,/deep/.cont1 uni-image,.cont1 .border-picture{
border-radius: 16rpx;
}
.text-info {
padding: 10rpx 20rpx 15rpx;
.title {
color: #222222;
overflow:hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.old-price {
margin-top: 4rpx;
font-size: 26rpx;
color: #999;
text-decoration: line-through;
text {
margin-right: 2px;
font-size: 20rpx;
}
}
.price {
display: flex;
margin-top: 20rpx;
font-size: 26rpx;
align-items: center;
text {
font-size: 36rpx;
font-weight: 550;
}
.ot-price{
color: #aaa;
font-size: 26rpx;
text-decoration: line-through;
margin-left: 6rpx;
font-weight: normal;
margin-top: 10rpx;
}
}
}
.pictrue {
position: relative;
}
.border-picture {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 8rpx;
background: center/cover no-repeat;
}
}
.merchant_info{
display: flex;
align-items: center;
margin-top: 20rpx;
.merchant_type{
color: #fff;
line-height: 30rpx;
padding: 0 10rpx;
border-radius: 2rpx;
font-size: 22rpx;
}
.txt {
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 28rpx;
margin-left: 15rpx;
border: 1px solid $theme-color;
border-radius: 4rpx;
font-size: 20rpx;
font-weight: normal;
&.delivery{
margin-left: 0;
color: #FF9000;
border-color: #FF9000;
}
}
}
&.on {
display: flex;
}
&.listA {
.item {
display: flex;
width: 100%;
.pictrue,/deep/image,/deep/.easy-loadimage,/deep/uni-image {
width: 220rpx;
height: 220rpx;
}
.sell_out {
display: flex;
width: 110rpx;
height: 110rpx;
align-items: center;
justify-content: center;
border-radius: 100%;
background: rgba(0,0,0,.6);
color: #fff;
font-size: 24rpx;
position: absolute;
top: 50%;
left: 50%;
margin: -55rpx 0 0 -55rpx;
&::before{
content: "";
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 100%;
border: 1px dashed #fff;
position: absolute;
top: 5rpx;
left: 5rpx;
}
}
.text-info {
width: 490rpx;
}
}
}
&.listB {
justify-content: inherit;
.item {
width: 31.3%;
margin-right: 3.05%;
.pictrue,/deep/image,/deep/.easy-loadimage,/deep/uni-image {
height: 220rpx;
}
.sell_out {
display: flex;
width: 110rpx;
height: 110rpx;
align-items: center;
justify-content: center;
border-radius: 100%;
background: rgba(0,0,0,.6);
color: #fff;
font-size: 24rpx;
position: absolute;
top: 50%;
left: 50%;
margin: -55rpx 0 0 -55rpx;
&::before{
content: "";
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 100%;
border: 1px dashed #fff;
position: absolute;
top: 5rpx;
left: 5rpx;
}
}
&:nth-child(3n) {
margin-right: 0;
}
.price{
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
text{
font-size: 28rpx;
}
}
.text-info{
padding: 10rpx 4rpx;
}
}
}
&.listC{
.item{
width: 100%;
.pictrue,/deep/image,/deep/.easy-loadimage,/deep/uni-image{
height: 320rpx;
}
.price{
margin-top: 20rpx;
font-size: 40rpx;
display: flex;
align-items: center;
.old-price{
font-weight: normal;
font-size: 22rpx;
margin-left: 10rpx;
}
}
}
}
&.listS{
.price{
font-size: 40rpx;
display: flex;
align-items: baseline;
.old-price{
font-weight: normal;
font-size: 22rpx;
margin-left: 10rpx;
}
}
}
}
</style>

View File

@ -451,7 +451,7 @@
import { HTTP_REQUEST_URL } from '@/config/app';
import mConfig from '../component/index.js';
// #ifdef MP || APP-PLUS
import activeParty from '../../index/component/activeParty';
import activeParty from '@/pages/index/component/activeParty';
import coupon from '../../index/component/coupon';
import bargain from '../../index/component/bargain';
import blankPage from '../../index/component/blankPage';
@ -1120,6 +1120,9 @@
},
//
tab: function(param) {
if(this.tabActive==param){
return false;
}
this.goods = []
this.tabActive = param;
this.goodsLoading = this.loadend = this.loading = false

View File

@ -199,6 +199,7 @@
// #ifdef MP
//openid
if (data.user.wechat_user_id === 0) {
let that=this
wx.getUserInfo({
success: function (res) {
const encryptedData = res.encryptedData
@ -206,7 +207,7 @@
wx.login({
success (res) {
if (res.code) {
bindMp({code: res.code, iv: iv, encryptedData: encryptedData}).then(res => {
bindMp({code: res.code, iv: iv, encryptedData: encryptedData,phone: that.account}).then(res => {
// console.log(res);
})
} else {