Browse Source

feat:新增小程序随访

lsw 9 months ago
parent
commit
2351c0581f

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4620946_tkp8n5lag3a.ttf?t=1721203311581') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_fqi31jzmzp7.ttf?t=1721209495536') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 107 - 50
app/pages/follow/detail.vue

@@ -1,19 +1,31 @@
 <template>
 	<view class="main">
-		<view class="content">
-			<view class="title">{{ item.title }}</view>
-			<view class="desc">
-				<text class="time">发布于:{{ item.createTime }}</text>
-				<button class="fx" open-type="share">
-					<text class="icon">&#xe637;</text>
-					<text>分享</text>
-				</button>
+		<view class="title">{{ item.title }}</view>
+		<u-divider text="开始"></u-divider>
+		<view class="item" v-for="(item, index) in item.op" :key="item.name">
+			<view class="mtt">
+				<text class="ifnull" v-if="item.ifnull == '必填'">*</text>
+				<text class="index">{{ index + 1 }}、</text>
+				<text class="tm">{{ item.name }}</text>
+				<text class="dx">({{ item.input }})</text>
 			</view>
-			<view class="con">
-				<u-divider :dot="true"></u-divider>
-				<u-parse :content="item.content"></u-parse>
+			<view class="mts">
+				<input v-if="item.input == '填空'" v-model="item.s_value" placeholder="请输入" />
+				<input v-if="item.input == '数字' || item.input == '电话'" type="number" v-model="item.s_value" placeholder="请输入" :disabled="look ? true : false" />
+				<textarea v-if="item.input == '多行文本'" v-model="item.s_value" placeholder="请输入" />
+				<view v-if="item.input == '附件'">
+					<images v-model="item.s_value" :read="look ? true : false"></images>
+					<view class="fjsc" v-if="!look">最多添加5个附件,单个文件不超过20M。</view>
+				</view>
+				<view class="ops" v-if="item.input == '单选' || item.input == '多选' || item.input == '判断'">
+					<view v-for="(op, i) in item.selects" :key="op.name">
+						<view class="op" :class="{ active: op.check }" @click="check(item, op)">{{ op.name }}</view>
+					</view>
+				</view>
 			</view>
 		</view>
+		<u-divider text="结束"></u-divider>
+		<button class="btn">立即提交</button>
 	</view>
 </template>
 
@@ -21,67 +33,112 @@
 export default {
 	data() {
 		return {
+			look: false,
 			item: {}
 		};
 	},
 	onLoad(e) {
 		this.http.request({
-			url: '/app/knowledge/detail/' + e.id,
+			url: '/app/follow/detail/115',
 			success: (res) => {
 				this.item = res.data.data;
-				this.item.content = res.data.data.content.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
+				this.item.op = JSON.parse(this.item.op);
 			}
 		});
 	},
-	methods: {},
-	//分享
-	onShareAppMessage: function (res) {
-		return {
-			title: this.item.title,
-			path: '/pages/knowledge/detail?id=' + this.item.id,
-			success: (res) => {},
-			fail: (res) => {}
-		};
-	}
+	methods: {}
 };
 </script>
 
 <style lang="scss">
-.main {
-	padding: 0px 10px 10px 10px;
+.title {
+	text-align: center;
 }
-.content {
-	padding: 15px;
-	background-color: white;
-	border-radius: 8px;
-	.title {
-		font-size: 18px;
-	}
-	.desc {
-		padding-top: 15px;
-		font-size: 13px;
-		color: #7c8388;
-		.time {
-			padding-right: 25px;
+.item {
+	.mtt {
+		text-align: left;
+		font-size: 16px;
+		padding: 12px 0px 12px 0px;
+		position: relative;
+		color: $font-c;
+		.ifnull {
+			color: red;
+			font-weight: bold;
+		}
+		.tm {
+			padding-left: 0px;
 		}
-		.fx {
+		.dx {
+			font-size: 12px;
+			color: #989898;
+		}
+	}
+	input {
+		background-color: white;
+		border-radius: 5px;
+		padding: 12px;
+		font-size: 14px;
+	}
+	textarea {
+		background-color: white;
+		border-radius: 5px;
+		width: 93%;
+		padding: 12px;
+		font-size: 14px;
+		height: 70px;
+	}
+	.ops {
+		margin-top: -5px;
+		overflow: hidden;
+		.op {
+			padding: 8px;
 			background-color: white;
-			float: right;
-			font-size: 15px;
-			margin-right: -14px;
-			margin-top: -13px;
-			color: $main-color;
-			.icon {
-				padding-right: 3px;
+			margin-top: 10px;
+			font-size: 14px;
+			border-radius: 3px;
+			color: #656363;
+			float: left;
+			margin-right: 7px;
+			&.active {
+				background-color: $main-color;
+				color: white;
 			}
 		}
 	}
-	.con {
+	.choice {
+		background-color: white;
+		margin-top: 5px;
+		padding: 12px;
+		border-radius: 3px;
+		font-size: 14px;
+		color: #656363;
+		overflow: hidden;
+		.omit {
+			width: 80%;
+			float: left;
+		}
+		.gx {
+			font-weight: bold;
+			color: #4581fb;
+			padding-left: 5px;
+		}
+		.icon {
+			float: right;
+			margin-top: 3px;
+		}
+	}
+	.up {
 		font-size: 14px;
-		line-height: 23px;
-		image {
-			border-radius: 5px !important;
+		color: #989898;
+		position: relative;
+		.icon {
+			padding-right: 3px;
 		}
 	}
+	.fjsc {
+		color: #989898;
+		font-size: 14px;
+		margin-top: 5px;
+	}
 }
 </style>

+ 1 - 0
app/uni.scss

@@ -8,6 +8,7 @@ $main-color:#4581fb;
 $font-c:#545555;
 $font-c1:#333;
 $bg:#e6ebfb;
+$inp:#eeeeee;
 $border-radius:5px;
 $box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_FollowTemplateController.java → ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_FollowController.java

@@ -20,8 +20,8 @@ import java.util.List;
  * @date 2024-07-11
  */
 @RestController
-@RequestMapping("/app/follow/template")
-public class Api_FollowTemplateController extends BaseController {
+@RequestMapping("/app/follow")
+public class Api_FollowController extends BaseController {
     @Autowired
     private IFollowTemplateService followTemplateService;
 

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/InterceptorConfig.java

@@ -23,6 +23,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
         registration.excludePathPatterns("/app/user/login"); //排除
         registration.excludePathPatterns("/app/home/**"); //排除
         registration.excludePathPatterns("/app/knowledge/**"); //排除
+        registration.excludePathPatterns("/app/follow/**"); //排除
         registration.excludePathPatterns("/app/common/type/*"); //排除
         registration.excludePathPatterns("/app/common/introduction/*"); //排除
     }