Browse Source

尝试修改成合作标

master
С·æ 4 years ago
parent
commit
3400350c5a
  1. 65
      src/Coldairarrow.Api/Controllers/HuiYan/albbitemlabelsController.cs
  2. 24
      src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs
  3. 2
      src/Coldairarrow.Api/appsettings.json
  4. 65
      src/Coldairarrow.Business/HuiYan/albbitemlabelsBusiness.cs
  5. 66
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  6. 29
      src/Coldairarrow.Entity/DTO/ItemLabelDto.cs
  7. 8
      src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs
  8. 41
      src/Coldairarrow.Entity/HuiYan/albbitemlabels.cs
  9. 5
      src/Coldairarrow.Entity/HuiYan/items.cs
  10. 16
      src/Coldairarrow.IBusiness/HuiYan/IalbbitemlabelsBusiness.cs
  11. 2
      src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs
  12. 4
      src/Coldairarrow.Web/.env
  13. 80
      src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/EditForm.vue
  14. 157
      src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/List.vue
  15. 46
      客户端/齐越慧眼/齐越慧眼/ApiHelper.cs
  16. 29
      客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs
  17. 32
      客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs
  18. 77
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

65
src/Coldairarrow.Api/Controllers/HuiYan/albbitemlabelsController.cs

@ -0,0 +1,65 @@
using Coldairarrow.Business.HuiYan;
using Coldairarrow.Entity.HuiYan;
using Coldairarrow.Util;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Coldairarrow.Api.Controllers.HuiYan
{
[Route("/HuiYan/[controller]/[action]")]
public class albbitemlabelsController : BaseApiController
{
#region DI
public albbitemlabelsController(IalbbitemlabelsBusiness albbitemlabelsBus)
{
_albbitemlabelsBus = albbitemlabelsBus;
}
IalbbitemlabelsBusiness _albbitemlabelsBus { get; }
#endregion
#region 获取
[HttpPost]
public async Task<PageResult<albbitemlabels>> GetDataList(PageInput<ConditionDTO> input)
{
return await _albbitemlabelsBus.GetDataListAsync(input);
}
[HttpPost]
public async Task<albbitemlabels> GetTheData(IdInputDTO input)
{
return await _albbitemlabelsBus.GetTheDataAsync(input.id);
}
#endregion
#region 提交
[HttpPost]
public async Task SaveData(albbitemlabels data)
{
if (data.Id.IsNullOrEmpty())
{
InitEntity(data);
await _albbitemlabelsBus.AddDataAsync(data);
}
else
{
await _albbitemlabelsBus.UpdateDataAsync(data);
}
}
[HttpPost]
public async Task DeleteData(List<string> ids)
{
await _albbitemlabelsBus.DeleteDataAsync(ids);
}
#endregion
}
}

24
src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs

@ -82,10 +82,32 @@ namespace Coldairarrow.Api.Controllers.HuiYan
/// <param name="platform"></param>
/// <returns></returns>
[HttpPost]
public AjaxResult GetLabelByItemIds([FromBody] List<string> ids, [FromQuery] ItemPlatform platform)
{
return _itemlabelsBus.GetLabelByItemIds(ids, platform);
}
/// <summary>
/// 检索阿里巴巴合作标签的商品
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost]
public AjaxResult GetAlbbLabelByShopIds([FromBody] List<string> ids)
{
return _itemlabelsBus.GetAlbbLabelByShopIds(ids);
}
/// <summary>
/// 设置阿里巴巴店铺合作
/// </summary>
/// <param name="shopId"></param>
/// <returns></returns>
[HttpPost]
public AjaxResult SetAlbbCooperation(string shopId)
{
return _itemlabelsBus.SetAlbbCooperation(shopId);
}
}
}

2
src/Coldairarrow.Api/appsettings.json

@ -43,7 +43,7 @@
//"DatabaseType": "PostgreSql",
//"ConnectionString": "Server=127.0.0.1;Port=5432;Database=Colder.Admin.AntdVue;User Id=postgres;Password=postgres;"
"DatabaseType": "MySql",
"ConnectionString": "server=116.62.61.68;user id=jdhy;password=kaicn1132+-;persistsecurityinfo=True;database=jdhy;SslMode=none;AllowLoadLocalInfile=true"
"ConnectionString": "server=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;user id=qyroot;password=kaicn1132+-;persistsecurityinfo=True;database=jdhy;SslMode=none;AllowLoadLocalInfile=true"
//"DatabaseType": "Oracle",
//"ConnectionString": "Data Source=127.0.0.1/ORCL;User ID=COLDER.ADMIN.ANTDVUE;Password=123456;Connect Timeout=3"
}

65
src/Coldairarrow.Business/HuiYan/albbitemlabelsBusiness.cs

@ -0,0 +1,65 @@
using Coldairarrow.Entity.HuiYan;
using Coldairarrow.Util;
using EFCore.Sharding;
using LinqKit;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
namespace Coldairarrow.Business.HuiYan
{
public class albbitemlabelsBusiness : BaseBusiness<albbitemlabels>, IalbbitemlabelsBusiness, ITransientDependency
{
public albbitemlabelsBusiness(IDbAccessor db)
: base(db)
{
}
#region 外部接口
public async Task<PageResult<albbitemlabels>> GetDataListAsync(PageInput<ConditionDTO> input)
{
var q = GetIQueryable();
var where = LinqHelper.True<albbitemlabels>();
var search = input.Search;
//筛选
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty())
{
var newWhere = DynamicExpressionParser.ParseLambda<albbitemlabels, bool>(
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword);
where = where.And(newWhere);
}
return await q.Where(where).GetPageResultAsync(input);
}
public async Task<albbitemlabels> GetTheDataAsync(string id)
{
return await GetEntityAsync(id);
}
public async Task AddDataAsync(albbitemlabels data)
{
await InsertAsync(data);
}
public async Task UpdateDataAsync(albbitemlabels data)
{
await UpdateAsync(data);
}
public async Task DeleteDataAsync(List<string> ids)
{
await DeleteAsync(ids);
}
#endregion
#region 私有成员
#endregion
}
}

66
src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs

@ -99,6 +99,12 @@ namespace Coldairarrow.Business.HuiYan
return Success(list);
}
public AjaxResult GetAlbbLabelByShopIds(List<string>ids)
{
var list= Db.GetIQueryable<albbitemlabels>().Where(c => ids.Contains(c.ShopId));
return Success(list);
}
public AjaxResult SetItemLabel(ItemLabelDto model)
{
@ -114,7 +120,7 @@ namespace Coldairarrow.Business.HuiYan
Deleted = false,
GoodsId = model.ItemId,
Id = IdHelper.GetId(),
HasFilter = model.Status == 1,
HasFilter = model.Status == ItemLabelStatus.Filter,
Platform = (int)model.Platform
};
@ -126,10 +132,16 @@ namespace Coldairarrow.Business.HuiYan
isAddItem = true;
}
////判断是否阿里巴巴合作
//if (model.Status == ItemLabelStatus.Cooperation)
//{
// return SetAlbbCooperation(item);
//}
var where = LinqHelper.True<itemlabels>().And(c => c.ItemsId == item.Id);
//团队筛选
//where = where.And(c=>c.TeamId=="");
where = where.And(c=>c.TeamId==_operator.TeamId);
var label = GetIQueryable().FirstOrDefault(where);
@ -154,16 +166,16 @@ namespace Coldairarrow.Business.HuiYan
switch (model.Status)
{
case 0:
case ItemLabelStatus.Screening:
label.IsScreening = true;
break;
case 1:
case ItemLabelStatus.Filter:
label.IsFilter = true;
break;
case 2:
case ItemLabelStatus.Added:
label.IsAdded = true;
break;
case 3:
case ItemLabelStatus.Competing:
label.IsCompeting = true;
break;
}
@ -181,21 +193,21 @@ namespace Coldairarrow.Business.HuiYan
{
switch (model.Status)
{
case 0:
case ItemLabelStatus.Screening:
if (label.IsFilter)
throw new Exception("该商品已被过滤!");
data.IsScreening = true;
break;
case 1:
case ItemLabelStatus.Filter:
if (label.IsScreening)
throw new Exception("该商品已被筛选!");
data.IsFilter = true;
break;
case 2:
case ItemLabelStatus.Added:
//加入产品库同时也勾选筛选
data.IsAdded = true;
break;
case 3:
case ItemLabelStatus.Competing:
data.IsCompeting = true;
break;
}
@ -205,13 +217,13 @@ namespace Coldairarrow.Business.HuiYan
}
//设置集团过滤
if (model.Status == 1&& !isAddItem)
if (model.Status == ItemLabelStatus.Filter&& !isAddItem)
{
Db.Update<items>(c => c.Id == item.Id, (i) => { i.HasFilter = true; });
}
//判断是否添加产品库
if (model.Status==2&&!hasAdded)
if (model.Status== ItemLabelStatus.Added&&!hasAdded)
{
if (!iteamitemsBusiness.AddItem(new TeamitemDto()
{
@ -234,5 +246,35 @@ namespace Coldairarrow.Business.HuiYan
return Error(result.ex.Message);
}
/// <summary>
/// 设置阿里巴巴合作
/// </summary>
/// <returns></returns>
public AjaxResult SetAlbbCooperation(string shopId)
{
int count= Db.GetIQueryable<albbitemlabels>().Count(c => c.ShopId == shopId);
if (count > 0)
{
return Error("已存在相同的合作店铺!");
}
int row= Db.Insert<albbitemlabels>(new albbitemlabels()
{
CreateTime = DateTime.Now,
CreatorId = _operator.UserId,
Deleted = false,
Id = IdHelper.GetId(),
ShopId = shopId
});
if (row > 0)
return Success();
else
{
return Error();
}
}
}
}

29
src/Coldairarrow.Entity/DTO/ItemLabelDto.cs

@ -21,7 +21,7 @@ namespace Coldairarrow.Entity.DTO
/// <summary>
/// 标签状态
/// </summary>
public int Status { get; set; }
public ItemLabelStatus Status { get; set; }
/// <summary>
/// 平台
@ -47,4 +47,31 @@ namespace Coldairarrow.Entity.DTO
/// </summary>
ALBB = 2
}
/// <summary>
/// 标签状态
/// </summary>
public enum ItemLabelStatus
{
/// <summary>
/// 筛选
/// </summary>
Screening=0,
/// <summary>
/// 过滤
/// </summary>
Filter =1,
/// <summary>
/// 添加产品库
/// </summary>
Added=2,
/// <summary>
/// 竞品
/// </summary>
Competing=3,
/// <summary>
/// 合作
/// </summary>
Cooperation=4
}
}

8
src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs

@ -24,4 +24,12 @@ namespace Coldairarrow.Entity.DTO
/// </summary>
public string GoodsId { get; set; }
}
public class AlbbItemlabelInfoDto : albbitemlabels
{
/// <summary>
/// 宝贝ID
/// </summary>
public string GoodsId { get; set; }
}
}

41
src/Coldairarrow.Entity/HuiYan/albbitemlabels.cs

@ -0,0 +1,41 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Coldairarrow.Entity.HuiYan
{
/// <summary>
/// albbitemlabels
/// </summary>
[Table("albbitemlabels")]
public class albbitemlabels
{
/// <summary>
/// 主键
/// </summary>
[Key, Column(Order = 1)]
public String Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人Id
/// </summary>
public String CreatorId { get; set; }
/// <summary>
/// 否已删除
/// </summary>
public Boolean Deleted { get; set; }
/// <summary>
/// 店铺ID
/// </summary>
public String ShopId { get; set; }
}
}

5
src/Coldairarrow.Entity/HuiYan/items.cs

@ -37,6 +37,11 @@ namespace Coldairarrow.Entity.HuiYan
/// </summary>
public String GoodsId { get; set; }
/// <summary>
/// 店铺ID
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 是否集团过滤
/// </summary>

16
src/Coldairarrow.IBusiness/HuiYan/IalbbitemlabelsBusiness.cs

@ -0,0 +1,16 @@
using Coldairarrow.Entity.HuiYan;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Coldairarrow.Business.HuiYan
{
public interface IalbbitemlabelsBusiness
{
Task<PageResult<albbitemlabels>> GetDataListAsync(PageInput<ConditionDTO> input);
Task<albbitemlabels> GetTheDataAsync(string id);
Task AddDataAsync(albbitemlabels data);
Task UpdateDataAsync(albbitemlabels data);
Task DeleteDataAsync(List<string> ids);
}
}

2
src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs

@ -16,5 +16,7 @@ namespace Coldairarrow.Business.HuiYan
AjaxResult SetItemLabel(ItemLabelDto model);
AjaxResult GetLabelByItemIds(List<string> ids, ItemPlatform platform);
AjaxResult GetAlbbLabelByShopIds(List<string> ids);
AjaxResult SetAlbbCooperation(string shopId);
}
}

4
src/Coldairarrow.Web/.env

@ -7,8 +7,8 @@ VUE_APP_DesktopPath=/Home/Introduce
#发布后接口根地址
VUE_APP_PublishRootUrl=http://hyapi.qiyue666.com
#本地调试接口根地址
#VUE_APP_LocalRootUrl=http://localhost:5000
VUE_APP_LocalRootUrl=http://hyapi.qiyue666.com
VUE_APP_LocalRootUrl=http://localhost:5000
#VUE_APP_LocalRootUrl=http://hyapi.qiyue666.com
#接口超时时间ms
VUE_APP_ApiTimeout=10000
#本地开发启动端口

80
src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/EditForm.vue

@ -0,0 +1,80 @@
<template>
<a-modal
:title="title"
width="40%"
:visible="visible"
:confirmLoading="loading"
@ok="handleSubmit"
@cancel="()=>{this.visible=false}"
>
<a-spin :spinning="loading">
<a-form-model ref="form" :model="entity" :rules="rules" v-bind="layout">
<a-form-model-item label="商品ID" prop="ItemId">
<a-input v-model="entity.ItemId" autocomplete="off" />
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
export default {
props: {
parentObj: Object
},
data() {
return {
layout: {
labelCol: { span: 5 },
wrapperCol: { span: 18 }
},
visible: false,
loading: false,
entity: {},
rules: {},
title: ''
}
},
methods: {
init() {
this.visible = true
this.entity = {}
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
},
openForm(id, title) {
this.init()
if (id) {
this.loading = true
this.$http.post('/HuiYan/albbitemlabels/GetTheData', { id: id }).then(resJson => {
this.loading = false
this.entity = resJson.Data
})
}
},
handleSubmit() {
this.$refs['form'].validate(valid => {
if (!valid) {
return
}
this.loading = true
this.$http.post('/HuiYan/albbitemlabels/SaveData', this.entity).then(resJson => {
this.loading = false
if (resJson.Success) {
this.$message.success('操作成功!')
this.visible = false
this.parentObj.getDataList()
} else {
this.$message.error(resJson.Msg)
}
})
})
}
}
}
</script>

157
src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/List.vue

@ -0,0 +1,157 @@
<template>
<a-card :bordered="false">
<div class="table-operator">
<a-button type="primary" icon="plus" @click="hanldleAdd()">新建</a-button>
<a-button
type="primary"
icon="minus"
@click="handleDelete(selectedRowKeys)"
:disabled="!hasSelected()"
:loading="loading"
>删除</a-button>
<a-button type="primary" icon="redo" @click="getDataList()">刷新</a-button>
</div>
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="10">
<a-col :md="4" :sm="24">
<a-form-item label="查询类别">
<a-select allowClear v-model="queryParam.condition">
<a-select-option key="ItemId">商品ID</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item>
<a-input v-model="queryParam.keyword" placeholder="关键字" />
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-button type="primary" @click="() => {this.pagination.current = 1; this.getDataList()}">查询</a-button>
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-table
ref="table"
:columns="columns"
:rowKey="row => row.Id"
:dataSource="data"
:pagination="pagination"
:loading="loading"
@change="handleTableChange"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:bordered="true"
size="small"
>
<span slot="action" slot-scope="text, record">
<template>
<a @click="handleEdit(record.Id)">编辑</a>
<a-divider type="vertical" />
<a @click="handleDelete([record.Id])">删除</a>
</template>
</span>
</a-table>
<edit-form ref="editForm" :parentObj="this"></edit-form>
</a-card>
</template>
<script>
import EditForm from './EditForm'
const columns = [
{ title: '商品ID', dataIndex: 'ItemId', width: '10%' },
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' } }
]
export default {
components: {
EditForm
},
mounted() {
this.getDataList()
},
data() {
return {
data: [],
pagination: {
current: 1,
pageSize: 10,
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}`
},
filters: {},
sorter: { field: 'Id', order: 'asc' },
loading: false,
columns,
queryParam: {},
selectedRowKeys: []
}
},
methods: {
handleTableChange(pagination, filters, sorter) {
this.pagination = { ...pagination }
this.filters = { ...filters }
this.sorter = { ...sorter }
this.getDataList()
},
getDataList() {
this.selectedRowKeys = []
this.loading = true
this.$http
.post('/HuiYan/albbitemlabels/GetDataList', {
PageIndex: this.pagination.current,
PageRows: this.pagination.pageSize,
SortField: this.sorter.field || 'Id',
SortType: this.sorter.order,
Search: this.queryParam,
...this.filters
})
.then(resJson => {
this.loading = false
this.data = resJson.Data
const pagination = { ...this.pagination }
pagination.total = resJson.Total
this.pagination = pagination
})
},
onSelectChange(selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys
},
hasSelected() {
return this.selectedRowKeys.length > 0
},
hanldleAdd() {
this.$refs.editForm.openForm()
},
handleEdit(id) {
this.$refs.editForm.openForm(id)
},
handleDelete(ids) {
var thisObj = this
this.$confirm({
title: '确认删除吗?',
onOk() {
return new Promise((resolve, reject) => {
thisObj.$http.post('/HuiYan/albbitemlabels/DeleteData', ids).then(resJson => {
resolve()
if (resJson.Success) {
thisObj.$message.success('操作成功!')
thisObj.getDataList()
} else {
thisObj.$message.error(resJson.Msg)
}
})
})
}
})
}
}
}
</script>

46
客户端/齐越慧眼/齐越慧眼/ApiHelper.cs

@ -10,8 +10,8 @@ namespace 齐越慧眼
{
public class ApiHelper
{
//public static string ApiBase { get; set; } = "http://localhost:5000";
public static string ApiBase { get; set; } = "http://hyapi.qiyue666.com";
public static string ApiBase { get; set; } = "http://localhost:5000";
//public static string ApiBase { get; set; } = "http://hyapi.qiyue666.com";
public static string JwtToken { get; set; }
@ -66,7 +66,49 @@ namespace 齐越慧眼
return (isSuccess, data.Msg ?? "");
}
/// <summary>
/// 设置阿里巴巴店铺合作状态
/// </summary>
/// <param name="shopId"></param>
/// <returns></returns>
public static (bool isOk, string msg) SetAlbbCooperation(string shopId)
{
var result = Http($"/HuiYan/itemlabels/SetAlbbCooperation?shopId={shopId}", "");
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(result);
bool isSuccess = data.Success;
return (isSuccess, data.Msg ?? "");
}
/// <summary>
/// 获取标签信息
/// </summary>
/// <param name="ids"></param>
/// <param name="platform"></param>
/// <returns></returns>
public static (bool isOk, List<albbitemlabels> datas) GetAlbbLabelByShopIds(List<string> ids)
{
try
{
var result = Http($"/HuiYan/itemlabels/GetAlbbLabelByShopIds", Newtonsoft.Json.JsonConvert.SerializeObject(ids));
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(result);
string json = data.Data.ToString();
var datas = Newtonsoft.Json.JsonConvert.DeserializeObject<List<albbitemlabels>>(json);
bool isSuccess = data.Success;
return (isSuccess, datas ?? new List<albbitemlabels>());
}
catch
{
return (false, new List<albbitemlabels>());
}
}
/// <summary>

29
客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs

@ -19,7 +19,7 @@ namespace 齐越慧眼.Models
/// <summary>
/// 标签状态
/// </summary>
public int Status { get; set; }
public ItemLabelStatus Status { get; set; }
/// <summary>
/// 平台
@ -45,4 +45,31 @@ namespace 齐越慧眼.Models
/// </summary>
ALBB = 2
}
/// <summary>
/// 标签状态
/// </summary>
public enum ItemLabelStatus
{
/// <summary>
/// 筛选
/// </summary>
Screening = 0,
/// <summary>
/// 过滤
/// </summary>
Filter = 1,
/// <summary>
/// 添加产品库
/// </summary>
Added = 2,
/// <summary>
/// 竞品
/// </summary>
Competing = 3,
/// <summary>
/// 合作
/// </summary>
Cooperation = 4
}
}

32
客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs

@ -4,6 +4,38 @@ using System.Text;
namespace .Models
{
public class albbitemlabels
{
/// <summary>
/// 主键
/// </summary>
public String Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人Id
/// </summary>
public String CreatorId { get; set; }
/// <summary>
/// 否已删除
/// </summary>
public Boolean Deleted { get; set; }
/// <summary>
/// 商品ID
/// </summary>
public String ShopId { get; set; }
}
public class ItemlabelInfoDto : itemlabels
{
/// <summary>

77
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

@ -8,6 +8,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using .cefhelper;
using .Models;
namespace .UserControls
{
@ -268,7 +269,6 @@ namespace 齐越慧眼.UserControls
if (item.IsCompeting)
{
//<div style=""width:20%;height:20%"" class=""bgYellow"">竞</div>
if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateYellow').length").result <= 0)
{
DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">竞</div>')");
@ -464,7 +464,9 @@ namespace 齐越慧眼.UserControls
reports.ForEach(c =>
{
string objid = Regex.Match(c, "object_id\\@(.*?)\\^").Groups[1].Value;
string shopId= Regex.Match(c, "object_id\\@(.*?)\\^").Groups[1].Value;
DoJavaScript(@$"$(""ul#sm-offer-list"").find('div[data-aplus-report=""{c}""]').attr(""data-sku"",""{objid}"")");
DoJavaScript(@$"$(""ul#sm-offer-list"").find('div[data-aplus-report=""{c}""]').attr(""data-shopId"",""{shopId}"")");
itemIds.Add(objid);
});
}
@ -492,15 +494,14 @@ namespace 齐越慧眼.UserControls
}
if (item.IsCompeting)
{
//<div style=""width:20%;height:20%"" class=""bgYellow"">竞</div>
if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#J_goodsList li[data-sku=""{item.GoodsId}""]')).find('.stateYellow').length").result <= 0)
{
DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">竞</div>')");
}
DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.stateGraydiv').addClass(""divshow"")");
}
//if (item.IsCompeting)
//{
// if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#J_goodsList li[data-sku=""{item.GoodsId}""]')).find('.stateYellow').length").result <= 0)
// {
// DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">合</div>')");
// }
// DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.stateGraydiv').addClass(""divshow"")");
//}
if (item.IsScreening)
{
@ -515,6 +516,18 @@ namespace 齐越慧眼.UserControls
}
}
}
var alResult = ApiHelper.GetAlbbLabelByShopIds(itemIds);
if (alResult.isOk)
{
alResult.datas.ForEach(item => {
DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{item.ShopId}""]')).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">合</div>')");
DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{item.ShopId}""]')).find('.stateGraydiv').addClass(""divshow"")");
});
}
}
/// <summary>
@ -548,7 +561,7 @@ namespace 齐越慧眼.UserControls
<div class=""myitemState"">
<div class=""stateGraydiv""></div></div>
<div class=""myopdiv"">
<div class=""bgYellow"" style=""display:flex;"" onclick=""optClick(this,3)""></div>
<div class=""bgYellow"" style=""display:flex;"" onclick=""optClick(this,4)""></div>
<div class=""bgZs"" style=""display:flex;"" onclick=""optClick(this,2)"" ></div>
<div class=""bgPig"" style=""display:flex;"" onclick=""optClick(this,1)""></div>
<div class=""bgGreen"" style=""display:flex;"" onclick=""optClick(this,0)""></div>
@ -802,7 +815,7 @@ namespace 齐越慧眼.UserControls
Platform = Models.ItemPlatform.Taobao,
Price = Convert.ToDecimal(price),
Sales = sales,
Status = type,
Status = (ItemLabelStatus)type,
Title = title
});
@ -868,7 +881,7 @@ namespace 齐越慧眼.UserControls
Platform = Models.ItemPlatform.Jd,
Price = Convert.ToDecimal(price),
Sales = sales,
Status = type,
Status = (ItemLabelStatus)type,
Title = title
});
@ -926,6 +939,27 @@ namespace 齐越慧眼.UserControls
title = title.Trim();
string img = data.img;
string itemId = data.itemid;
string shopId = data.shopId;
if (type == 4)
{
var result = ApiHelper.SetAlbbCooperation(shopId);
if (result.isOk)
{
int row = (int)BrowerControl.Main.DoJavaScript(@$"return $($('ul#sm-offer-list div[data-shopId=""{shopId}""]')).find('.myitemState').find('.stateYellow').length").result;
if (row < 1)
{
BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{shopId}""]')).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">合</div>')");
}
}
WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示");
return result.isOk;
}
else
{
var result = ApiHelper.SetItemLabel(new Models.ItemLabelDto()
{
@ -934,7 +968,7 @@ namespace 齐越慧眼.UserControls
Platform = Models.ItemPlatform.ALBB,
Price = Convert.ToDecimal(price),
Sales = sales,
Status = type,
Status = (ItemLabelStatus)type,
Title = title
});
@ -946,15 +980,6 @@ namespace 齐越慧眼.UserControls
BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""falseBg"")");
}
if (type == 3)
{
int row = (int)BrowerControl.Main.DoJavaScript(@$"return $($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').find('.stateYellow').length").result;
if (row < 1)
{
BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""stateYellow"">竞</div>')");
}
}
if (type == 0)
{
BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""trueBg"")");
@ -967,11 +992,11 @@ namespace 齐越慧眼.UserControls
BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.stateGraydiv').addClass(""divshow"")");
}
WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示");
return result.isOk;
}
}
}
}

Loading…
Cancel
Save